diff options
author | Matt Caswell <matt@openssl.org> | 2017-11-21 18:18:43 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2017-12-04 14:31:48 +0100 |
commit | f63a17d66dec01c123630682e0b20450b34c086a (patch) | |
tree | 6f12a8572a3f21bca6bec20941fa3793369230b0 /ssl/tls_srp.c | |
parent | Replace some usage of SSLerr with SSLfatal() (diff) | |
download | openssl-f63a17d66dec01c123630682e0b20450b34c086a.tar.xz openssl-f63a17d66dec01c123630682e0b20450b34c086a.zip |
Convert the state machine code to use SSLfatal()
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4778)
Diffstat (limited to 'ssl/tls_srp.c')
-rw-r--r-- | ssl/tls_srp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ssl/tls_srp.c b/ssl/tls_srp.c index d1683c5449..d3ce8c7341 100644 --- a/ssl/tls_srp.c +++ b/ssl/tls_srp.c @@ -257,9 +257,13 @@ int srp_generate_server_master_secret(SSL *s) goto err; tmp_len = BN_num_bytes(K); - if ((tmp = OPENSSL_malloc(tmp_len)) == NULL) + if ((tmp = OPENSSL_malloc(tmp_len)) == NULL) { + SSLfatal(s, SSL_AD_INTERNAL_ERROR, + SSL_F_SRP_GENERATE_SERVER_MASTER_SECRET, ERR_R_MALLOC_FAILURE); goto err; + } BN_bn2bin(K, tmp); + /* Calls SSLfatal() as required */ ret = ssl_generate_master_secret(s, tmp, tmp_len, 1); err: BN_clear_free(K); |