Browse Source

Send an error rather than assert when decrypt_len != rsa_size.

With SSL_PRIVATE_KEY_METHOD, decryption can happen outside of BoringSSL. Rather than crash the process, it would be nicer if BoringSSL handled the error gracefully.

Change-Id: I3f24d066f7a329d41420b208a7e13c82ec966710
Reviewed-on: https://boringssl-review.googlesource.com/7683
Reviewed-by: David Benjamin <davidben@google.com>
kris/onging/CECPQ3_patch15
Daniel Bathgate 8 years ago
committed by David Benjamin
parent
commit
4365c3f522
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      ssl/s3_srvr.c

+ 5
- 1
ssl/s3_srvr.c View File

@@ -1575,7 +1575,11 @@ int ssl3_get_client_key_exchange(SSL *ssl) {
goto err;
}

assert(decrypt_len == rsa_size);
if (decrypt_len != rsa_size) {
al = SSL_AD_DECRYPT_ERROR;
OPENSSL_PUT_ERROR(SSL, SSL_R_DECRYPTION_FAILED);
goto f_err;
}

/* Prepare a random premaster, to be used on invalid padding. See RFC 5246,
* section 7.4.7.1. */


Loading…
Cancel
Save