-
Notifications
You must be signed in to change notification settings - Fork 32
Fortify is unable to communicate with smartcard while signing operation. #576
Comments
Currently, we are not seeing issue ("error":"CKR_DATA_INVALID") with OpenSSL ECDSA algorithm. (maybe intermittent issue) |
@pmhatre-swi I will check this and provide a report as soon as possible. |
Thanks to today's meeting, I was able to reproduce the error The new version of Fortify, v2, employs a different approach that will resolve this error. Additionally, you can build the chain on the client side using the |
I have published the updated version of |
I checked the chain created using: https://peculiarventures.github.io/fortify-examples/example6.html I have uploaded Client certificate in slot 9a (Authentication) and Intermediate certificate in slot 9d (Key Management) |
I checked with the new example. Fortify logs shows that ykcs11 library is used. attaching Developer console logs, Fortify Logs, Yubikey Slot Details and Certificate chain. (Root certificate, Intermediate certificate and Client certificate) |
Please update your In the
|
I updated my ~/.fortify/card.json file. and made changes to library path to point to the Yubico PIV Tools lib. I also updated my Yubikey Manager to the latest version. Currently I have Yubikey Manager 1.2.6 installed on my Laptop. Still I see only Client certificate in the Web Developer tools. Fortify logs shows that libykcs11.dll library used is from Yubico PIV tool. Please find attached Fortify Logs: |
Hi @microshine Can you please check at your end whether entire certificate chain is fetched by the example that you have created? Please find attached certificate chain that we are using on our Yubikey [with RSASSA-PSS algorithm] |
I'm not sure that
I'll check it and share the result shortly |
I tried fetching the list of certificates and building the chain on my Yubikey using the provided link. The screenshot (attached) shows that the chain consists of 3 certificates. A total of 4 certificates were extracted from the token. The certificate not included in the chain is the key attestation certificate.
I attempted to build the certificate chain. The I ran a similar setup on NodeJS, and the construction was successful because NodeJS uses a different crypto provider that supports this algorithm for public keys. To resolve this issue in the browser, we can extend the x509 module to add the capability to convert such keys into a browser-supported format. This could involve either re-encoding the SPKI with the RsaEncryption algorithm or converting the SPKI to JWK. This problem occurs in both Chrome and Safari browsers. Example of RSA-PSS Key Structure in ASN.1 (formatted)SEQUENCE (2 elem)
SEQUENCE (2 elem)
OBJECT IDENTIFIER 1.2.840.113549.1.1.10 rsaPSS (PKCS #1)
SEQUENCE (3 elem)
[0] (1 elem)
SEQUENCE (1 elem)
OBJECT IDENTIFIER 2.16.840.1.101.3.4.2.1 sha-256 (NIST Algorithm)
[1] (1 elem)
SEQUENCE (2 elem)
OBJECT IDENTIFIER 1.2.840.113549.1.1.8 pkcs1-MGF (PKCS #1)
SEQUENCE (1 elem)
OBJECT IDENTIFIER 2.16.840.1.101.3.4.2.1 sha-256 (NIST Algorithm)
[2] (1 elem)
INTEGER 222
BIT STRING (2160 bit) 001100001000001000000001000010100000001010000010000000010000000100000…
SEQUENCE (2 elem)
INTEGER (2048 bit) 271189003140513352642996286075904296179645053014555503155676400457157…
INTEGER 65537 Example of the Same Key with RsaEncryption OIDSEQUENCE (2 elem)
SEQUENCE (2 elem)
OBJECT IDENTIFIER 1.2.840.113549.1.1.1 rsaEncryption (PKCS #1)
NULL
BIT STRING (2160 bit) 001100001000001000000001000010100000001010000010000000010000000100000…
SEQUENCE (2 elem)
INTEGER (2048 bit) 271189003140513352642996286075904296179645053014555503155676400457157…
INTEGER 65537 By making these adjustments, we can ensure compatibility with browser cryptography APIs and successfully build the certificate chain in Chrome and Safari. |
@pmhatre-swi I have updated and published a new build for |
I have managed to resolve the issue with using Yubico on Windows. The problem was that Fortify could not load the necessary dependencies from the Yubico directory when loading the module. This can be fixed by adding the path Here are the steps to resolve this issue:
|
Hi @microshine, I tried above steps. Below are my observations.
{"level":"info","library":"C:\Program Files\Yubico\Yubico PIV Tool\bin\libykcs11.dll","message":"Loading PKCS#11 library","source":"provider","timestamp":"2024-05-28T07:01:42.718Z"}
|
Let's try another approach to retrieve the list of certificates using the Please follow these steps:
Example output:
If OpenSC shows all necessary certificates, it may indicate an issue within Fortify. If it returns only two certificates, it could point to a limitation or configuration issue with the Let me know the output of this command so we can further diagnose the issue. |
Due to organization security reason, I need to take IT permission to install OpenSC on our Laptop. Meanwhile, Can you try to upload certificate chain (Client cert, Intermediate cert and Root cert) on your Yubikey and try the same with OpenSC? |
We tried to retrieve list of certificates using pkcs11-tool utility from the OpenSC package.
|
We are able to generate the certificate chain with RSASSA-PSS algorithm with below conditions using fortify example: https://peculiarventures.github.io/fortify-examples/example6.html Pre-requisites:
Entire certificate chain is generated with Fortify Example with above steps. |
While signing the operations from Airvantage signing portal, We observe an exception "Fortify is unable to communicate with smartcard." ()
We have loaded client certificate in slot 9A (Authentication slot) and intermediate certificate in slot 9d (Key Management slot) of the Yubikey.
We have also tried with slot 82-95 for uploading certificate chain (Intermediate certificate / Root certificate) on Yubikey.
We observe the issue when certificate chain (Root - Intermediate - Client) is based on OpenSSL ECDSA algorithm or Microsoft CA rsassa-pss algorithm.
Attached Fortify logs for the reference.
Fortify_logs.txt
Details are provided below:
OS -Windows 11
Browser - Firefox 125.0.3
Yubikey - YubiKey 5 NFC (FW: 5.4.3)
The text was updated successfully, but these errors were encountered: