You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As shown in the snipped below, this library isn't currently honouring the hashing algorithm or setting a salt length when generating RSA-PSS keys, as it wasn't supported in older versions of Node.js:
I think this crypto.generateKeyPairSync() call should be changed to set the type to rsa-pss (only if using RSA-PSS) and add the following options if the current Node.js version is >= 16.10.0:
hashAlgorithm and mgf1HashAlgorithm: This value is already available in the context (algorithm.hash.name).
saltLength: Should match the length of the digest from hashAlgorithm (e.g., 32 for SHA-256), following industry best practices (see, for example, TLS 1.3 and GCP KMS key algorithms).
I suspect this might be a breaking change in those apps/libs using the default values of MGF1 with SHA-1 and saltLength=20 (I think PKI.js' SignedData and Certificatemight be affected from a cursory look at CryptoEngine but haven't had the time to double check).
The text was updated successfully, but these errors were encountered:
As shown in the snipped below, this library isn't currently honouring the hashing algorithm or setting a salt length when generating RSA-PSS keys, as it wasn't supported in older versions of Node.js:
webcrypto/src/mechs/rsa/crypto.ts
Lines 37 to 48 in 37dff39
I think this
crypto.generateKeyPairSync()
call should be changed to set the type torsa-pss
(only if using RSA-PSS) and add the following options if the current Node.js version is >= 16.10.0:hashAlgorithm
andmgf1HashAlgorithm
: This value is already available in the context (algorithm.hash.name
).saltLength
: Should match the length of the digest fromhashAlgorithm
(e.g.,32
for SHA-256), following industry best practices (see, for example, TLS 1.3 and GCP KMS key algorithms).I suspect this might be a breaking change in those apps/libs using the default values of MGF1 with SHA-1 and
saltLength=20
(I think PKI.js'SignedData
andCertificate
might be affected from a cursory look atCryptoEngine
but haven't had the time to double check).The text was updated successfully, but these errors were encountered: