Pkcs11-tool.c -t fails to for RSA-X-509 verification

The test_signature routine reuses data array and fails to reset data[0] = 0
when creating a PKCS hash to be pased to OpenSSL.

 Date:	     Mon Feb 13 11:48:00 2017 -0600

 On branch pkcs11-tool-pkcs
 Changes to be committed:
	modified:   tools/pkcs11-tool.c
This commit is contained in:
Doug Engert 2017-02-12 20:34:13 -06:00 committed by Frank Morgner
parent f1f96a6b40
commit 2a68395d22
1 changed files with 1 additions and 0 deletions

View File

@ -4301,6 +4301,7 @@ static int test_signature(CK_SESSION_HANDLE sess)
/* Fill in data[0] and dataLens[0] */
dataLen = modLenBytes;
data[0] = 0x00;
data[1] = 0x01;
memset(data + 2, 0xFF, dataLen - 3 - dataLens[1]);
data[dataLen - 36] = 0x00;