summaryrefslogtreecommitdiffstats
path: root/crypto/pem
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2016-11-16 23:03:43 +0000
committerDr. Stephen Henson <steve@openssl.org>2016-11-17 03:53:02 +0000
commit159f6e7ecfde9e98194d6111c85587b85b6a8fc5 (patch)
tree0743bde0f6ea1f942357efa3686bf72be6963365 /crypto/pem
parentbad6b116a2d3c005330e618c726f172fd0fefc2a (diff)
Fix MSBLOB format with RSA.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/pem')
-rw-r--r--crypto/pem/pvkfmt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/pem/pvkfmt.c b/crypto/pem/pvkfmt.c
index 416bfc2a47..248704ec59 100644
--- a/crypto/pem/pvkfmt.c
+++ b/crypto/pem/pvkfmt.c
@@ -548,7 +548,7 @@ static void write_rsa(unsigned char **out, RSA *rsa, int ispub)
hnbyte = (RSA_bits(rsa) + 15) >> 4;
RSA_get0_key(rsa, &n, &e, &d);
write_lebn(out, e, 4);
- write_lebn(out, n, -1);
+ write_lebn(out, n, nbyte);
if (ispub)
return;
RSA_get0_factors(rsa, &p, &q);