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
Hi, the SoftHSM2 implementation of GCM decrypt does not return any data until you call C_DecryptFinal (not sure if other P11 implementations are the same), so the final() method in decipher.ts is failing since it only allocates one block for the plaintext, but SoftHSM2 is expecting a buffer equal to the plaintext length.
public final(): Buffer {
const dec = Buffer.alloc(this.blockSize);
const res = this.lib.C_DecryptFinal(this.session.handle, dec);
return res;
Originally posted by tstiemerling April 3, 2024
Are there any examples of using AES GCM mode? I am trying to use graphene with SoftHSM2 (windows build) and I getting CKR_BUFFER_TOO_SMALL returned on decrypt (unit test). The offending SoftHSM code seems to be here:
c:\build\src\softhsm-2.5.0-x64\src\lib\softhsm.cpp(3256): Output buffer too short ulEncryptedDataLen: 0x10 output buffer size: 0x20 blockSize: 0x10 remainingSize: 0x100 maxSize: 0x110
The text was updated successfully, but these errors were encountered:
Hi, the SoftHSM2 implementation of GCM decrypt does not return any data until you call C_DecryptFinal (not sure if other P11 implementations are the same), so the final() method in decipher.ts is failing since it only allocates one block for the plaintext, but SoftHSM2 is expecting a buffer equal to the plaintext length.
public final(): Buffer {
const dec = Buffer.alloc(this.blockSize);
}
Discussed in #159
Originally posted by tstiemerling April 3, 2024
Are there any examples of using AES GCM mode? I am trying to use graphene with SoftHSM2 (windows build) and I getting CKR_BUFFER_TOO_SMALL returned on decrypt (unit test). The offending SoftHSM code seems to be here:
c:\build\src\softhsm-2.5.0-x64\src\lib\softhsm.cpp(3256): Output buffer too short ulEncryptedDataLen: 0x10 output buffer size: 0x20 blockSize: 0x10 remainingSize: 0x100 maxSize: 0x110
The text was updated successfully, but these errors were encountered: