From c2512ee261efb6fdd81226549f48421bd57a8230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Trojnara?= Date: Mon, 3 Sep 2018 20:54:59 +0200 Subject: [PATCH 20/23] Build fixes for old C dialects --- src/p11_cert.c | 3 ++- src/p11_key.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/p11_cert.c b/src/p11_cert.c index 811db85..bc78447 100644 --- a/src/p11_cert.c +++ b/src/p11_cert.c @@ -74,6 +74,7 @@ int pkcs11_remove_certificate(PKCS11_CERT *cert){ CK_ULONG count; CK_ATTRIBUTE search_parameters[32]; unsigned int n = 0; + int rv; /* First, make sure we have a session */ if (!spriv->haveSession && PKCS11_open_session(slot, 1)){ @@ -88,7 +89,7 @@ int pkcs11_remove_certificate(PKCS11_CERT *cert){ pkcs11_addattr_s(search_parameters + n++, CKA_LABEL, cert->label); } - int rv = CRYPTOKI_call(ctx, + rv = CRYPTOKI_call(ctx, C_FindObjectsInit(spriv->session, search_parameters, n)); CRYPTOKI_checkerr(CKR_F_PKCS11_REMOVE_CERTIFICATE, rv); diff --git a/src/p11_key.c b/src/p11_key.c index 1681c7d..f73029b 100644 --- a/src/p11_key.c +++ b/src/p11_key.c @@ -457,6 +457,7 @@ int pkcs11_remove_key(PKCS11_KEY *key) { CK_ULONG count; CK_ATTRIBUTE search_parameters[32]; unsigned int n = 0; + int rv; /* First, make sure we have a session */ if (!spriv->haveSession && PKCS11_open_session(slot, 1)) @@ -470,7 +471,7 @@ int pkcs11_remove_key(PKCS11_KEY *key) { if (key->label) pkcs11_addattr_s(search_parameters + n++, CKA_LABEL, key->label); - int rv = CRYPTOKI_call(ctx, + rv = CRYPTOKI_call(ctx, C_FindObjectsInit(spriv->session, search_parameters, n)); CRYPTOKI_checkerr(CKR_F_PKCS11_REMOVE_KEY, rv); -- 2.17.1