Replies: 2 comments 13 replies
-
|
Yes, when pam-u2f creates a 'challenge', it's really generating the entire client data hash. This is incompatible with how WebAuthn's contextual binding works. In other words, a signature created through the browser API will not verify in pam-u2f. |
Beta Was this translation helpful? Give feedback.
-
|
@LDVG I will be presenting at FOSDEM on Sunday about Cockpit and passkeys, will be talking about pam-u2f, libfido2, and the work we're doing to make things work with WebAuthn. If you're curious it'll be livestreamed and also recorded :) https://fosdem.org/2026/schedule/event/CKXHVM-cockpit-passkeys/ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Spinning off from the RFE I reported here about the data sent to
pam-u2f.Currently, I'm trying to implement
pam-u2fauthentication to Cockpit by means of browser WebAuthn and passkeys.On Cockpit we try to use PAM modules for authentication where possible, though other authentication methods exist. But as the login is happening entirely within the browser with data sent back to
pam-u2fwe need to modify the data to adhere to whatpam-u2fexpects. But currently running into signature verification woes.I'm struggling at the moment to figure out where the issue lies at the moment, any ideas @LDVG?
For development I'm using Chromium virtual authenticator environment.
Registration is done with basic setup where I manually add
navigator.credentials.create()response data to/etc/u2f_mappings.Authentication is done by taking the challenge from
manualpam-u2fconfig, intonavigator.credentials.get()and then processing response data which is sent back tostdinExample registration
Browser URL is set to
https://localhost:9091/Setup for the
n.c.create():Which during registration gave me
{ "authenticatorAttachment": "cross-platform", "clientExtensionResults": {}, "id": "qQj4BP3AH91vc08Wiurcss4ixxjVKLkRX1oBpkfsAc0", "rawId": "qQj4BP3AH91vc08Wiurcss4ixxjVKLkRX1oBpkfsAc0", "response": { "attestationObject": "o2NmbXRmcGFja2VkZ2F0dFN0bXSjY2FsZyZjc2lnWEYwRAIgcW31Frhmc0T7cIM-bfe_bFWHbz8560IP1FF3wUv2uskCICBl6fYxsApshX2Hj0rn9DO-z5ZrvHz6k3BZXWOGv8RFY3g1Y4FZAdcwggHTMIIBeqADAgECAgEBMAoGCCqGSM49BAMCMGAxCzAJBgNVBAYTAlVTMREw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YXRlIiwiY2hhbGxlbmdlIjoiakFvbV95S1J3ZW01VGk0WEdwaHFjM0dkUTBnIiwib3JpZ2luIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6OTA5MSIsImNyb3NzT3JpZ2luIjpmYWxzZX0", "publicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEc08sEEuwN4mhOLulNB9n0awdQOtyr84OGJK52x5jLmW2bnfZ6SWnBT95AtFa_hWg3ehZpfTKhkLL6ZYhSaP5jg", "publicKeyAlgorithm": -7, "transports": [ "usb" ] }, "type": "public-key" }rawID:attestationObject:and from that I generate an entry and manually add to
/etc/u2f_mappingsbased onrawIDandattestationObjectresult:Example authentication
For authentication I've setup our PAM in
/etc/pam.d/cockpitto includeThen when calling
n.c.get()with this setup:With the following data sent to server:
That I have generated with the following code
based off of
{ "authenticatorAttachment": "cross-platform", "clientExtensionResults": {}, "id": "qQj4BP3AH91vc08Wiurcss4ixxjVKLkRX1oBpkfsAc0", "rawId": "qQj4BP3AH91vc08Wiurcss4ixxjVKLkRX1oBpkfsAc0", "response": { "authenticatorData": "SZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2MBAAAAAg", "clientDataJSON": "eyJ0eXBlIjoid2ViYXV0aG4uZ2V0IiwiY2hhbGxlbmdlIjoiQzZjcGN6TlJvcURCUDhac29xenRiUWIwVzFTeGtfNHYzbklwZ0h5bWtpOCIsIm9yaWdpbiI6Imh0dHBzOi8vbG9jYWxob3N0OjkwOTEiLCJjcm9zc09yaWdpbiI6ZmFsc2V9", "signature": "MEYCIQC5Y9ugvcYp1K4GMvCm8KXdtPu5JzK_1fjG7Yoq5M6ptgIhAI0byfiuRQ19vi4fRMmq_x-rdQJFjh9Ka04Z11QXYPCs" }, "type": "public-key" }rawId:authenticatorData:clientDataJSON:signature:I get the server logs for authentication failure specifically pointing to signature verification failure:
Beta Was this translation helpful? Give feedback.
All reactions