From: Matt Caswell <matt@openssl.org>
Date: Wed, 21 Sep 2016 13:05:42 +0000 (+0100)
Subject: make update and fix some associated mis-matched error codes
X-Git-Tag: OpenSSL_1_1_1-pre1~3487
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3c106325292d30fad32b0dd4cdf2f2ec613461b1;p=openssl

make update and fix some associated mis-matched error codes

Reviewed-by: Richard Levitte <levitte@openssl.org>
---

diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h
index 234a25e01a..5355c8302a 100644
--- a/include/openssl/ssl.h
+++ b/include/openssl/ssl.h
@@ -2220,6 +2220,7 @@ int ERR_load_SSL_strings(void);
 # define SSL_F_TLS1_SET_SERVER_SIGALGS                    335
 # define SSL_F_TLS_CLIENT_KEY_EXCHANGE_POST_WORK          354
 # define SSL_F_TLS_CONSTRUCT_CERTIFICATE_REQUEST          372
+# define SSL_F_TLS_CONSTRUCT_CHANGE_CIPHER_SPEC           427
 # define SSL_F_TLS_CONSTRUCT_CKE_DHE                      404
 # define SSL_F_TLS_CONSTRUCT_CKE_ECDHE                    405
 # define SSL_F_TLS_CONSTRUCT_CKE_GOST                     406
diff --git a/ssl/ssl_err.c b/ssl/ssl_err.c
index 7f94ca6491..bba7cdb7f7 100644
--- a/ssl/ssl_err.c
+++ b/ssl/ssl_err.c
@@ -239,6 +239,8 @@ static ERR_STRING_DATA SSL_str_functs[] = {
      "tls_client_key_exchange_post_work"},
     {ERR_FUNC(SSL_F_TLS_CONSTRUCT_CERTIFICATE_REQUEST),
      "tls_construct_certificate_request"},
+    {ERR_FUNC(SSL_F_TLS_CONSTRUCT_CHANGE_CIPHER_SPEC),
+     "tls_construct_change_cipher_spec"},
     {ERR_FUNC(SSL_F_TLS_CONSTRUCT_CKE_DHE), "tls_construct_cke_dhe"},
     {ERR_FUNC(SSL_F_TLS_CONSTRUCT_CKE_ECDHE), "tls_construct_cke_ecdhe"},
     {ERR_FUNC(SSL_F_TLS_CONSTRUCT_CKE_GOST), "tls_construct_cke_gost"},
diff --git a/ssl/statem/statem_dtls.c b/ssl/statem/statem_dtls.c
index f892f0f82e..7c8437a518 100644
--- a/ssl/statem/statem_dtls.c
+++ b/ssl/statem/statem_dtls.c
@@ -877,7 +877,7 @@ int dtls_construct_change_cipher_spec(SSL *s)
 
     if (!WPACKET_init(&pkt, s->init_buf)
             || !WPACKET_put_bytes_u8(&pkt, SSL3_MT_CCS)) {
-        SSLerr(SSL_F_TLS_CONSTRUCT_FINISHED, ERR_R_INTERNAL_ERROR);
+        SSLerr(SSL_F_DTLS_CONSTRUCT_CHANGE_CIPHER_SPEC, ERR_R_INTERNAL_ERROR);
         goto err;
     }
 
@@ -888,7 +888,7 @@ int dtls_construct_change_cipher_spec(SSL *s)
         s->d1->next_handshake_write_seq++;
 
         if (!WPACKET_put_bytes_u16(&pkt, s->d1->handshake_write_seq)) {
-            SSLerr(SSL_F_TLS_CONSTRUCT_FINISHED, ERR_R_INTERNAL_ERROR);
+            SSLerr(SSL_F_DTLS_CONSTRUCT_CHANGE_CIPHER_SPEC, ERR_R_INTERNAL_ERROR);
             goto err;
         }
 
@@ -896,7 +896,7 @@ int dtls_construct_change_cipher_spec(SSL *s)
     }
 
     if (!WPACKET_finish(&pkt)) {
-        SSLerr(SSL_F_TLS_CONSTRUCT_FINISHED, ERR_R_INTERNAL_ERROR);
+        SSLerr(SSL_F_DTLS_CONSTRUCT_CHANGE_CIPHER_SPEC, ERR_R_INTERNAL_ERROR);
         goto err;
     }
 
diff --git a/ssl/statem/statem_lib.c b/ssl/statem/statem_lib.c
index 3ffe4e5751..6f13ec0daa 100644
--- a/ssl/statem/statem_lib.c
+++ b/ssl/statem/statem_lib.c
@@ -276,7 +276,7 @@ int tls_construct_change_cipher_spec(SSL *s)
             || !WPACKET_finish(&pkt)) {
         WPACKET_cleanup(&pkt);
         ossl_statem_set_error(s);
-        SSLerr(SSL_F_TLS_CONSTRUCT_FINISHED, ERR_R_INTERNAL_ERROR);
+        SSLerr(SSL_F_TLS_CONSTRUCT_CHANGE_CIPHER_SPEC, ERR_R_INTERNAL_ERROR);
         ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR);
         return 0;
     }