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>
This commit is contained in:
parent
6142f5c640
commit
d8e8590ed9
@ -364,11 +364,15 @@ int dtls1_connect(SSL *s)
|
|||||||
sizeof(DTLS1_SCTP_AUTH_LABEL),
|
sizeof(DTLS1_SCTP_AUTH_LABEL),
|
||||||
DTLS1_SCTP_AUTH_LABEL);
|
DTLS1_SCTP_AUTH_LABEL);
|
||||||
|
|
||||||
SSL_export_keying_material(s, sctpauthkey,
|
if (SSL_export_keying_material(s, sctpauthkey,
|
||||||
sizeof(sctpauthkey),
|
sizeof(sctpauthkey),
|
||||||
labelbuffer,
|
labelbuffer,
|
||||||
sizeof(labelbuffer), NULL, 0,
|
sizeof(labelbuffer), NULL, 0,
|
||||||
0);
|
0) <= 0) {
|
||||||
|
ret = -1;
|
||||||
|
s->state = SSL_ST_ERR;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
BIO_ctrl(SSL_get_wbio(s),
|
BIO_ctrl(SSL_get_wbio(s),
|
||||||
BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY,
|
BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY,
|
||||||
@ -493,9 +497,13 @@ int dtls1_connect(SSL *s)
|
|||||||
snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL),
|
snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL),
|
||||||
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(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,
|
BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY,
|
||||||
sizeof(sctpauthkey), sctpauthkey);
|
sizeof(sctpauthkey), sctpauthkey);
|
||||||
|
@ -417,9 +417,13 @@ int dtls1_accept(SSL *s)
|
|||||||
snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL),
|
snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL),
|
||||||
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(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,
|
BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY,
|
||||||
sizeof(sctpauthkey), sctpauthkey);
|
sizeof(sctpauthkey), sctpauthkey);
|
||||||
@ -606,9 +610,13 @@ int dtls1_accept(SSL *s)
|
|||||||
snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL),
|
snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL),
|
||||||
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(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,
|
BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY,
|
||||||
sizeof(sctpauthkey), sctpauthkey);
|
sizeof(sctpauthkey), sctpauthkey);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user