diff options
author | Matt Caswell <matt@openssl.org> | 2015-08-11 19:36:43 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-08-11 22:16:38 +0100 |
commit | d8e8590ed90eba6ef651d09d77befb14f980de2c (patch) | |
tree | 8706f02ab9eedda94c310b03401a4894994c90b1 /ssl/d1_clnt.c | |
parent | 6142f5c640f98429d4798b8418e8cc2cf6cc1fb8 (diff) |
Fix missing return value checks in SCTP
There are some missing return value checks in the SCTP code. In master this
was causing a compilation failure when config'd with
"--strict-warnings sctp".
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'ssl/d1_clnt.c')
-rw-r--r-- | ssl/d1_clnt.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ssl/d1_clnt.c b/ssl/d1_clnt.c index 566c1545e7..d4116147b4 100644 --- a/ssl/d1_clnt.c +++ b/ssl/d1_clnt.c @@ -364,11 +364,15 @@ int dtls1_connect(SSL *s) sizeof(DTLS1_SCTP_AUTH_LABEL), DTLS1_SCTP_AUTH_LABEL); - SSL_export_keying_material(s, sctpauthkey, + if (SSL_export_keying_material(s, sctpauthkey, sizeof(sctpauthkey), labelbuffer, sizeof(labelbuffer), NULL, 0, - 0); + 0) <= 0) { + ret = -1; + s->state = SSL_ST_ERR; + goto end; + } BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY, @@ -493,9 +497,13 @@ int dtls1_connect(SSL *s) snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL), DTLS1_SCTP_AUTH_LABEL); - SSL_export_keying_material(s, sctpauthkey, + if (SSL_export_keying_material(s, sctpauthkey, sizeof(sctpauthkey), labelbuffer, - sizeof(labelbuffer), NULL, 0, 0); + sizeof(labelbuffer), NULL, 0, 0) <= 0) { + ret = -1; + s->state = SSL_ST_ERR; + goto end; + } BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY, sizeof(sctpauthkey), sctpauthkey); |