From 1c256544dda26e4042c1af082580a1b87c9a690f Mon Sep 17 00:00:00 2001 From: Matt Braithwaite Date: Tue, 12 Jul 2016 20:03:05 -0700 Subject: RSA_marshal_private_key: add missing CBB_flush() Change-Id: I2584bd86473be5b9d92a13b65dc78658a433a375 Reviewed-on: https://boringssl-review.googlesource.com/8737 Reviewed-by: David Benjamin --- crypto/rsa/rsa_asn1.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crypto') diff --git a/crypto/rsa/rsa_asn1.c b/crypto/rsa/rsa_asn1.c index d14ecaee..599a0c37 100644 --- a/crypto/rsa/rsa_asn1.c +++ b/crypto/rsa/rsa_asn1.c @@ -323,8 +323,8 @@ int RSA_marshal_private_key(CBB *cbb, const RSA *rsa) { return 0; } + CBB other_prime_infos; if (is_multiprime) { - CBB other_prime_infos; if (!CBB_add_asn1(&child, &other_prime_infos, CBS_ASN1_SEQUENCE)) { OPENSSL_PUT_ERROR(RSA, RSA_R_ENCODE_ERROR); return 0; @@ -338,7 +338,8 @@ int RSA_marshal_private_key(CBB *cbb, const RSA *rsa) { CBS_ASN1_SEQUENCE) || !marshal_integer(&other_prime_info, ap->prime) || !marshal_integer(&other_prime_info, ap->exp) || - !marshal_integer(&other_prime_info, ap->coeff)) { + !marshal_integer(&other_prime_info, ap->coeff) || + !CBB_flush(&other_prime_infos)) { OPENSSL_PUT_ERROR(RSA, RSA_R_ENCODE_ERROR); return 0; } -- cgit v1.2.3