DirectProjectJavaRI / agent

Direct Java RI Security and Trust Agent
Other
1 stars 3 forks source link

Decryption with HSM failing when decrypting OAEP padding. #7

Closed gm2552 closed 5 years ago

gm2552 commented 5 years ago

The agent throws an UnknownAlgorithmException when decrypting messages that use the OAEP padding scheme with RSA encryption.

java.security.NoSuchAlgorithmException: No such algorithm: 1.2.840.113549.1.1.7

This same error was encountered in previous versions of the agent due to HSMs not recognizing the AOEP OID. This was fixed by explicitly mapping the OAEP algorithm OID to the name "RSA/ECB/OAEP" if the BC provider was not selected (this generally happens when an HSM provider is configured). This fix effectively does the same mapping with the new BC libraries.

In the field, users of the .Net reference implementation are the only implementations that have been encountered to use OAEP and cause incoming message to fail. This error does not affect decrypting from other HISPs that do not use OAEP padding.

gm2552 commented 5 years ago

Fixed in version 6.0.2.