aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-08-01 12:10:11 +0100
committerMatt Caswell <matt@openssl.org>2016-08-01 12:10:11 +0100
commit1e7c159d0dd8dcbb77bab412e40daa34ab2ed749 (patch)
tree345c6a2b2fe1c26b28273d7e9534aceb7a576ba6 /crypto
parent68e71e9d000b72d964eb8b4106a1d879a0da4908 (diff)
downloadopenssl-1e7c159d0dd8dcbb77bab412e40daa34ab2ed749.zip
openssl-1e7c159d0dd8dcbb77bab412e40daa34ab2ed749.tar.gz
openssl-1e7c159d0dd8dcbb77bab412e40daa34ab2ed749.tar.bz2
Fix param order in RSA_get0_key
Some calls to RSA_get0_key had the parameters in the wrong order causing a failure. GitHub Issue #1368 Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/pem/pvkfmt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/pem/pvkfmt.c b/crypto/pem/pvkfmt.c
index bf512ec..05a79e6 100644
--- a/crypto/pem/pvkfmt.c
+++ b/crypto/pem/pvkfmt.c
@@ -497,7 +497,7 @@ static int check_bitlen_rsa(RSA *rsa, int ispub, unsigned int *pmagic)
int nbyte, hnbyte, bitlen;
const BIGNUM *e;
- RSA_get0_key(rsa, &e, NULL, NULL);
+ RSA_get0_key(rsa, NULL, &e, NULL);
if (BN_num_bits(e) > 32)
goto badkey;
bitlen = RSA_bits(rsa);
@@ -539,7 +539,7 @@ static void write_rsa(unsigned char **out, RSA *rsa, int ispub)
nbyte = RSA_size(rsa);
hnbyte = (RSA_bits(rsa) + 15) >> 4;
- RSA_get0_key(rsa, &e, &n, &d);
+ RSA_get0_key(rsa, &n, &e, &d);
write_lebn(out, e, 4);
write_lebn(out, n, -1);
if (ispub)