aboutsummaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2017-05-17 10:31:46 +0100
committerMatt Caswell <matt@openssl.org>2017-05-17 15:32:25 +0100
commit355a0d10a9a736202d3dbc41ce2218acb46a30ca (patch)
tree5e1052c26ba9680ee485705b8f5b4d956cff2fc6 /ssl
parent56c2a6d78354b395dfd0c535debbe063d71b30ab (diff)
downloadopenssl-355a0d10a9a736202d3dbc41ce2218acb46a30ca.tar.gz
Add a new unsolicited extension error code and add enum tag
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3418)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/ssl_err.c1
-rw-r--r--ssl/statem/extensions.c2
-rw-r--r--ssl/statem/statem_locl.h2
3 files changed, 3 insertions, 2 deletions
diff --git a/ssl/ssl_err.c b/ssl/ssl_err.c
index 62d7d76835..f7de9f61d9 100644
--- a/ssl/ssl_err.c
+++ b/ssl/ssl_err.c
@@ -843,6 +843,7 @@ static ERR_STRING_DATA SSL_str_reasons[] = {
{ERR_REASON(SSL_R_UNKNOWN_STATE), "unknown state"},
{ERR_REASON(SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED),
"unsafe legacy renegotiation disabled"},
+ {ERR_REASON(SSL_R_UNSOLICITED_EXTENSION), "unsolicited extension"},
{ERR_REASON(SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM),
"unsupported compression algorithm"},
{ERR_REASON(SSL_R_UNSUPPORTED_ELLIPTIC_CURVE),
diff --git a/ssl/statem/extensions.c b/ssl/statem/extensions.c
index 9854cf0db9..fd76337564 100644
--- a/ssl/statem/extensions.c
+++ b/ssl/statem/extensions.c
@@ -510,7 +510,7 @@ int tls_collect_extensions(SSL *s, PACKET *packet, unsigned int context,
&& type != TLSEXT_TYPE_renegotiate
&& type != TLSEXT_TYPE_signed_certificate_timestamp
&& (s->ext.extflags[idx] & SSL_EXT_FLAG_SENT) == 0) {
- SSLerr(SSL_F_TLS_COLLECT_EXTENSIONS, SSL_R_BAD_EXTENSION);
+ SSLerr(SSL_F_TLS_COLLECT_EXTENSIONS, SSL_R_UNSOLICITED_EXTENSION);
*al = SSL_AD_UNSUPPORTED_EXTENSION;
goto err;
}
diff --git a/ssl/statem/statem_locl.h b/ssl/statem/statem_locl.h
index 13fe5bfd67..673822a7c5 100644
--- a/ssl/statem/statem_locl.h
+++ b/ssl/statem/statem_locl.h
@@ -156,7 +156,7 @@ MSG_PROCESS_RETURN tls_process_end_of_early_data(SSL *s, PACKET *pkt);
/* Extension processing */
-typedef enum {
+typedef enum ext_return_en {
EXT_RETURN_FAIL,
EXT_RETURN_SENT,
EXT_RETURN_NOT_SENT