[pkg-opensc-commit] [libp11] 18/51: OpenSSL 1.1.0 build fixes
Eric Dorland
eric at moszumanska.debian.org
Wed Dec 7 17:51:31 UTC 2016
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository libp11.
commit f9feb93cacbd5983e166742decf4b80350d01ef1
Author: Michał Trojnara <Michal.Trojnara at stunnel.org>
Date: Tue Oct 25 22:05:50 2016 +0200
OpenSSL 1.1.0 build fixes
Closes #128
---
NEWS | 5 +++--
src/p11_ec.c | 12 +++++++-----
src/p11_key.c | 2 +-
src/p11_rsa.c | 4 ++--
4 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/NEWS b/NEWS
index ccc3577..b2d9202 100644
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,9 @@
NEWS for Libp11 -- History of user visible changes
New in 0.4.3; unreleased
-* Use UI to get the CKU_CONTEXT_SPECIFIC PIN (Michał Trojnara).
-* Fixed an EVP_PKEY refcount leak (David Woodhouse).
+* Use UI to get the CKU_CONTEXT_SPECIFIC PIN (Michał Trojnara)
+* Fixed an EVP_PKEY refcount leak (David Woodhouse)
+* OpenSSL 1.1.0 build fixes (Nikos Mavrogiannopoulos, Michał Trojnara)
New in 0.4.2; 2016-09-25; Michał Trojnara
* Fixed a 0.4.0 regression bug causing the engine finish function to
diff --git a/src/p11_ec.c b/src/p11_ec.c
index dd1742e..110ba91 100644
--- a/src/p11_ec.c
+++ b/src/p11_ec.c
@@ -274,17 +274,19 @@ static ECDSA_SIG *pkcs11_ecdsa_sign_sig(const unsigned char *dgst, int dlen,
if (pkcs11_ecdsa_sign(dgst, dlen, sigret, &siglen, key) <= 0)
return NULL;
+ r = BN_bin2bn(sigret, siglen/2, NULL);
+ s = BN_bin2bn(sigret + siglen/2, siglen/2, NULL);
sig = ECDSA_SIG_new();
if (sig == NULL)
return NULL;
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
- ECDSA_SIG_get0(&r, &s, sig);
+ ECDSA_SIG_set0(sig, r, s);
#else
- r = sig->r;
- s = sig->s;
+ BN_free(sig->r);
+ sig->r = r;
+ BN_free(sig->s);
+ sig->s = s;
#endif
- BN_bin2bn(sigret, siglen/2, r);
- BN_bin2bn(sigret + siglen/2, siglen/2, s);
return sig;
}
diff --git a/src/p11_key.c b/src/p11_key.c
index 3a38907..65667c2 100644
--- a/src/p11_key.c
+++ b/src/p11_key.c
@@ -223,7 +223,7 @@ static int pkcs11_store_key(PKCS11_TOKEN * token, EVP_PKEY * pk,
CK_ATTRIBUTE attrs[32];
unsigned int n = 0;
int rv;
- BIGNUM *rsa_n, *rsa_e, *rsa_d, *rsa_p, *rsa_q;
+ const BIGNUM *rsa_n, *rsa_e, *rsa_d, *rsa_p, *rsa_q;
/* First, make sure we have a session */
if (!spriv->haveSession && PKCS11_open_session(slot, 1))
diff --git a/src/p11_rsa.c b/src/p11_rsa.c
index e36bc76..f0aa822 100644
--- a/src/p11_rsa.c
+++ b/src/p11_rsa.c
@@ -271,7 +271,7 @@ static EVP_PKEY *pkcs11_get_evp_key_rsa(PKCS11_KEY *key)
int pkcs11_get_key_modulus(PKCS11_KEY *key, BIGNUM **bn)
{
RSA *rsa = pkcs11_rsa(key);
- BIGNUM *rsa_n;
+ const BIGNUM *rsa_n;
if (rsa == NULL)
return 0;
@@ -288,7 +288,7 @@ int pkcs11_get_key_modulus(PKCS11_KEY *key, BIGNUM **bn)
int pkcs11_get_key_exponent(PKCS11_KEY *key, BIGNUM **bn)
{
RSA *rsa = pkcs11_rsa(key);
- BIGNUM *rsa_e;
+ const BIGNUM *rsa_e;
if (rsa == NULL)
return 0;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/libp11.git
More information about the pkg-opensc-commit
mailing list