aboutsummaryrefslogtreecommitdiff
path: root/ssl/statem/statem_dtls.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2017-05-16 17:28:23 +0100
committerMatt Caswell <matt@openssl.org>2017-05-19 08:47:08 +0100
commitfb34a0f4e033246ef5f957bc57d2ebc904a519fc (patch)
tree1db7d3e04ad02459db6fb04dd264cf7936dc34e4 /ssl/statem/statem_dtls.c
parentd8028b202bfe337200a0cc89b80983ea1838cb30 (diff)
downloadopenssl-fb34a0f4e033246ef5f957bc57d2ebc904a519fc.zip
openssl-fb34a0f4e033246ef5f957bc57d2ebc904a519fc.tar.gz
openssl-fb34a0f4e033246ef5f957bc57d2ebc904a519fc.tar.bz2
Try to be more consistent about the alerts we send
We are quite inconsistent about which alerts get sent. Specifically, these alerts should be used (normally) in the following circumstances: SSL_AD_DECODE_ERROR = The peer sent a syntactically incorrect message SSL_AD_ILLEGAL_PARAMETER = The peer sent a message which was syntactically correct, but a parameter given is invalid for the context SSL_AD_HANDSHAKE_FAILURE = The peer's messages were syntactically and semantically correct, but the parameters provided were unacceptable to us (e.g. because we do not support the requested parameters) SSL_AD_INTERNAL_ERROR = We messed up (e.g. malloc failure) The standards themselves aren't always consistent but I think the above represents the best interpretation. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3480)
Diffstat (limited to 'ssl/statem/statem_dtls.c')
-rw-r--r--ssl/statem/statem_dtls.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ssl/statem/statem_dtls.c b/ssl/statem/statem_dtls.c
index b2ba357..5cab355 100644
--- a/ssl/statem/statem_dtls.c
+++ b/ssl/statem/statem_dtls.c
@@ -770,7 +770,7 @@ static int dtls_get_reassembled_message(SSL *s, int *errtype, size_t *len)
* Fragments must not span records.
*/
if (frag_len > RECORD_LAYER_get_rrec_length(&s->rlayer)) {
- al = SSL3_AD_ILLEGAL_PARAMETER;
+ al = SSL_AD_ILLEGAL_PARAMETER;
SSLerr(SSL_F_DTLS_GET_REASSEMBLED_MESSAGE, SSL_R_BAD_LENGTH);
goto f_err;
}
@@ -845,8 +845,8 @@ static int dtls_get_reassembled_message(SSL *s, int *errtype, size_t *len)
* to fail
*/
if (readbytes != frag_len) {
- al = SSL3_AD_ILLEGAL_PARAMETER;
- SSLerr(SSL_F_DTLS_GET_REASSEMBLED_MESSAGE, SSL3_AD_ILLEGAL_PARAMETER);
+ al = SSL_AD_ILLEGAL_PARAMETER;
+ SSLerr(SSL_F_DTLS_GET_REASSEMBLED_MESSAGE, SSL_R_BAD_LENGTH);
goto f_err;
}