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
I'm running into an issue signing a SHA3-384 hash of one of our images(SHA3-384 is required by the ROM of our device so we can't change what's used). Since yubihsm doesn't support SHA3, I opted to do the hash as well as encoding before signing and while it works if the asn1 ID part of the digest is for SHA2-384, it doesn't work if it's SHA3-384 even when the hash is the same but the asn1 ID is different.
For example, this is a hexdump of the SHA2-384 that was signed:
As you can see at 0x01c0 where the ASN1 ID portion is located, it's specified to be 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02 which specifies OID for SHA2-384. However, if I change this part to be 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x09 (differ the last byte), then yubihsm would complain about malformed data
This confuses me because I didn't think yubihsm would care about the ASN1 ID part, just that the data is correctly padded and of correct length. And weirdly, even if I gave it sha3-384 but specified in the asn1 part that it's sha2-384, yubihsm still signs it successfully so it looks like it doesn't really care if it's actually sha3-384 or sha2-384
In summary, is there a way to get the yubihsm to RSA sign a sha3-384 hash padded using pkcs1.5?
The text was updated successfully, but these errors were encountered:
SHA3 is currently not a supported algorithm. The YubiHSM checks what hash is used for two purposes - to determine if it is enabled, and secondly to add the proper OID if a raw hash is given, in which case the length of the hash is used to determine the hash algorithm. That is needed because the OID is part of a pkcs#1 signature. See https://developers.yubico.com/YubiHSM2/Commands/Sign_Pkcs1.html for info on what algorithms are supported.
So even if supplying a SHA2-384 OID works the signature will be incorrect when verified as a pkcs#1-sha3-384 signature (because the oid part of the signed data will be different), and also incorrect when verified as a pkcs#1-sha2-384 signature (because the hash part of the signed data will be different).
I'm running into an issue signing a SHA3-384 hash of one of our images(SHA3-384 is required by the ROM of our device so we can't change what's used). Since yubihsm doesn't support SHA3, I opted to do the hash as well as encoding before signing and while it works if the asn1 ID part of the digest is for SHA2-384, it doesn't work if it's SHA3-384 even when the hash is the same but the asn1 ID is different.
For example, this is a hexdump of the SHA2-384 that was signed:
As you can see at 0x01c0 where the ASN1 ID portion is located, it's specified to be 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02 which specifies OID for SHA2-384. However, if I change this part to be 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x09 (differ the last byte), then yubihsm would complain about malformed data
This confuses me because I didn't think yubihsm would care about the ASN1 ID part, just that the data is correctly padded and of correct length. And weirdly, even if I gave it sha3-384 but specified in the asn1 part that it's sha2-384, yubihsm still signs it successfully so it looks like it doesn't really care if it's actually sha3-384 or sha2-384
In summary, is there a way to get the yubihsm to RSA sign a sha3-384 hash padded using pkcs1.5?
The text was updated successfully, but these errors were encountered: