From: Dr. Stephen Henson Date: Wed, 16 Nov 2016 23:03:43 +0000 (+0000) Subject: Fix MSBLOB format with RSA. X-Git-Tag: OpenSSL_1_1_0d~116 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3ead66d1c0ce8e16ea2d4a1447c42073d7773e88;p=oweals%2Fopenssl.git Fix MSBLOB format with RSA. Reviewed-by: Rich Salz (cherry picked from commit 159f6e7ecfde9e98194d6111c85587b85b6a8fc5) --- 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);