diff options
author | Stef Walter <stef@memberwebs.com> | 2008-12-24 21:31:52 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2008-12-24 21:31:52 +0000 |
commit | f74e6747fbddcae866333d8dcb207cb8a2e4f280 (patch) | |
tree | f4a8818da5f6abc60a0483a292cc678b07bdb610 /src/key.c | |
parent | 8804d957de520b394b669e60b4cb1877b80778a2 (diff) |
A few last checks.
Diffstat (limited to 'src/key.c')
-rw-r--r-- | src/key.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -113,6 +113,26 @@ test_rsa_public(CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object) P11T_SECTION("CKK_RSA Public"); + /* + * These attribute buffer codes have already been tested here and there, but + * do it again since sometimes the big num code is different from general attrs. + */ + if(p11t_test_unexpected) { + + /* Too small */ + attr.type = CKA_MODULUS; + attr.pValue = modulus; + attr.ulValueLen = 4; + rv = (p11t_module_funcs->C_GetAttributeValue)(session, object, &attr, 1); + P11T_CHECK_RV("CKA_MODULUS", rv, CKR_BUFFER_TOO_SMALL); + + /* No buffer */ + attr.type = CKA_MODULUS; + attr.pValue = NULL; + rv = (p11t_module_funcs->C_GetAttributeValue)(session, object, &attr, 1); + P11T_CHECK_RV("CKA_MODULUS", rv, CKR_OK); + } + attr.type = CKA_MODULUS; attr.pValue = modulus; attr.ulValueLen = sizeof(modulus); |