openssl-pkcs11/openssl-pkcs11-0.4.8-fix-build-old-c-dialects.patch
Anderson Toshiyuki Sasaki 889aab18fc openssl-pkcs11-0.4.8-2
- Require OpenSSL >= 1.0.2
- Fixed missing declaration of ERR_get_CKR_code()
- Add support to use EC keys and tests (#1619184)
- Exposed check_fork() API
- Fixed memory leak of RSA objects in pkcs11_store_key()
- Updated OpenSSL license in eng_front.c
- Fixed build for old C dialects
- Allow engine to use private key without PIN
- Require DEBUG to be defined to print debug messages
- Changed package description (#1614699)
2018-09-18 10:02:33 +02:00

56 lines
1.7 KiB
Diff

From c2512ee261efb6fdd81226549f48421bd57a8230 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Trojnara?= <Michal.Trojnara@stunnel.org>
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