Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Check the TGT of user after auth for passkey #7393

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
passkey:UUDmIHJqneuAiCxFQViZ3Sth4jwIPir2SAsOS0jj/WFAi8kdPY5SwAmlWfLhJfi9GJHZiOAqnXgfSEXjUWdx4Q==,MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEnZWGeUbCGnaLN7sGLOX+iM+vQwnv1RLJMxr9tQRLTfn1pkzzHLVTeK0AWpOeOoQgHtiNFnIYx6Js8yzLAvocGQ==
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
d 0 /dev/hidraw1

w 2 ^@ÿÿÿÿ†^@^H^A^A^A^A^A^A^A^A^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
r 3 ÿÿÿÿ†^@^Q^A^A^A^A^A^A^A^A^CÏ^DÖ^B^E^D^C^E^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
w 1 ^@^CÏ^D֐^@^A^D^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
r 3 ^CÏ^D֐^@Ì^@¬^AƒfU2F_V2hFIDO_2_0lFIDO_2_1_PRE^B‚kcredProtectkhmac-secr^C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^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
48 changes: 48 additions & 0 deletions src/tests/system/tests/test_passkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from __future__ import annotations

import pytest
from pytest_mh import mh_fixture
from sssd_test_framework.roles.client import Client
from sssd_test_framework.roles.generic import GenericProvider
from sssd_test_framework.roles.ipa import IPA
Expand All @@ -26,6 +27,17 @@ def passkey_requires_root(client: Client) -> tuple[bool, str] | bool:
return True


@mh_fixture()
pbrezina marked this conversation as resolved.
Show resolved Hide resolved
def umockdev_ipaotpd_update(ipa: IPA, request: pytest.FixtureRequest):
"""
Update the [email protected] file from ipa server with
'Environment=LD_PRELOAD=/opt/random.so' to avoid the data mismatch
error while running the umockdev-run command while authenticating the user.
"""
ipa.fs.append("/usr/lib/systemd/system/[email protected]", "Environment=LD_PRELOAD=/opt/random.so")
ipa.svc.restart("ipa")


@pytest.mark.importance("high")
@pytest.mark.topology(KnownTopology.Client)
@pytest.mark.builtwith(client="passkey")
Expand Down Expand Up @@ -544,3 +556,39 @@ def test_passkey__su_fips_fido_key(client: Client, provider: GenericProvider, mo
ioctl=f"{moduledatadir}/umockdev.ioctl",
script=f"{testdatadir}/umockdev.script.{suffix}",
)


@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopology.IPA)
@pytest.mark.builtwith(client="passkey", ipa="passkey")
@pytest.mark.require.with_args(passkey_requires_root)
def test_passkey__check_tgt(client: Client, ipa: IPA, moduledatadir: str, testdatadir: str, umockdev_ipaotpd_update):
"""
:title: Check the TGT of user after authentication.
:setup:
1. Add a user with --user-auth-type=passkey in the server with passkey mapping.
2. Setup SSSD client with FIDO and umockdev, start SSSD service.
:steps:
1. Check authentication of the user
2. Check TGT after authenticates.
:expectedresults:
1. User authenticates successfully.
2. Gets the TGT.
:customerscenario: False
"""
with open(f"{testdatadir}/passkey-mapping.ipa") as f:
ipa.user("user1").add(user_auth_type="passkey").passkey_add(f.read().strip())

client.sssd.start()

rc, _, output, _ = client.auth.su.passkey_with_output(
username="user1",
pin=123456,
device=f"{moduledatadir}/umockdev.device",
ioctl=f"{moduledatadir}/umockdev.ioctl",
script=f"{testdatadir}/umockdev.script.ipa",
command="klist",
)

assert rc == 0, "Authentication failed"
assert "Ticket cache" in output, "Failed to get the TGT"
Loading