Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorMatt Braithwaite <mab@google.com>2016-07-13 06:03:05 +0300
committerDavid Benjamin <davidben@google.com>2016-07-13 06:49:41 +0300
commit1c256544dda26e4042c1af082580a1b87c9a690f (patch)
tree53dad68cca16859bd3783001cd950bbe02ba10a5 /crypto
parent8d343b44bbab829d1a28fdef650ca95f7db4412e (diff)
RSA_marshal_private_key: add missing CBB_flush()
Change-Id: I2584bd86473be5b9d92a13b65dc78658a433a375 Reviewed-on: https://boringssl-review.googlesource.com/8737 Reviewed-by: David Benjamin <davidben@google.com>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/rsa/rsa_asn1.c5
1 files changed, 3 insertions, 2 deletions
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;
}