lib: warn, but don't fail on error reading serial number or version

lib: fix Windows build with OpenSSL 1.1.1
ykcs11: fix size_t/unsigned long type mismatch on Windows x64
This commit is contained in:
Dave Pate
2019-05-06 14:46:46 -07:00
parent 00ced78b7a
commit c61d6c6f23
3 changed files with 23 additions and 4 deletions
+6 -2
View File
@@ -1842,6 +1842,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_Sign)(
{
ykpiv_rc piv_rv;
CK_RV rv;
size_t cbSignatureLen = 0;
DIN;
@@ -1934,9 +1935,12 @@ CK_DEFINE_FUNCTION(CK_RV, C_Sign)(
dump_data(op_info.buf, op_info.buf_len, stderr, CK_TRUE, format_arg_hex);
#endif
*pulSignatureLen = sizeof(op_info.buf);
*pulSignatureLen = cbSignatureLen = sizeof(op_info.buf);
piv_rv = ykpiv_sign_data(piv_state, op_info.buf, op_info.buf_len, op_info.buf, &cbSignatureLen, op_info.op.sign.algo, op_info.op.sign.key_id);
*pulSignatureLen = cbSignatureLen;
piv_rv = ykpiv_sign_data(piv_state, op_info.buf, op_info.buf_len, op_info.buf, pulSignatureLen, op_info.op.sign.algo, op_info.op.sign.key_id);
if (piv_rv != YKPIV_OK) {
if (piv_rv == YKPIV_AUTHENTICATION_ERROR) {
DBG("Operation requires authentication or touch");