From 23bc7961d2486254082be1ba0eb4bedb8bfbcfb3 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Wed, 16 Mar 2011 16:17:46 +0000 Subject: [PATCH] Fix broken SRP error/function code assignment. --- ssl/s3_clnt.c | 6 +++--- ssl/s3_srvr.c | 8 ++++---- ssl/ssl.h | 21 ++++++++++----------- ssl/ssl_err.c | 3 +-- 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index e0b9d9147c..f96ec4f984 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -283,7 +283,7 @@ int ssl3_connect(SSL *s) { if (!SRP_have_to_put_srp_username(s)) { - SSLerr(SSL_F_SSL3_GET_SERVER_HELLO,SSL_R_MISSING_SRP_USERNAME); + SSLerr(SSL_F_SSL3_CONNECT,SSL_R_MISSING_SRP_USERNAME); ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_USER_CANCELLED); goto end; } @@ -378,7 +378,7 @@ int ssl3_connect(SSL *s) { if ((ret = SRP_Calc_A_param(s))<=0) { - SSLerr(SSL_F_SSL3_GET_SERVER_DONE,SSL_R_SRP_A_CALC); + SSLerr(SSL_F_SSL3_CONNECT,SSL_R_SRP_A_CALC); ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_INTERNAL_ERROR); goto end; } @@ -2703,7 +2703,7 @@ int ssl3_send_client_key_exchange(SSL *s) if ((s->session->master_key_length = SRP_generate_client_master_secret(s,s->session->master_key))<0) { - SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,ERR_R_INTERNAL_ERROR); + SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,ERR_R_INTERNAL_ERROR); goto err; } } diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c index 3a3e7f9ffc..871909eced 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -366,7 +366,7 @@ int ssl3_accept(SSL *s) break; } ret = -1; - SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_CLIENTHELLO_TLSEXT); + SSLerr(SSL_F_SSL3_ACCEPT,SSL_R_CLIENTHELLO_TLSEXT); goto end; } } @@ -2727,12 +2727,12 @@ int ssl3_get_client_key_exchange(SSL *s) if (param_len > n) { al=SSL_AD_DECODE_ERROR; - SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,SSL_R_BAD_SRP_A_LENGTH); + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_BAD_SRP_A_LENGTH); goto f_err; } if (!(s->srp_ctx.A=BN_bin2bn(p,i,NULL))) { - SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,ERR_R_BN_LIB); + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,ERR_R_BN_LIB); goto err; } if (s->session->srp_username != NULL) @@ -2747,7 +2747,7 @@ int ssl3_get_client_key_exchange(SSL *s) if ((s->session->master_key_length = SRP_generate_server_master_secret(s,s->session->master_key))<0) { - SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,ERR_R_INTERNAL_ERROR); + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,ERR_R_INTERNAL_ERROR); goto err; } diff --git a/ssl/ssl.h b/ssl/ssl.h index de5027f5c4..49faba7a7a 100644 --- a/ssl/ssl.h +++ b/ssl/ssl.h @@ -2167,7 +2167,7 @@ void ERR_load_SSL_strings(void); #define SSL_F_SSL_SET_TRUST 228 #define SSL_F_SSL_SET_WFD 196 #define SSL_F_SSL_SHUTDOWN 224 -#define SSL_F_SSL_SRP_CTX_INIT 293 +#define SSL_F_SSL_SRP_CTX_INIT 305 #define SSL_F_SSL_UNDEFINED_CONST_FUNCTION 243 #define SSL_F_SSL_UNDEFINED_FUNCTION 197 #define SSL_F_SSL_UNDEFINED_VOID_FUNCTION 244 @@ -2226,11 +2226,11 @@ void ERR_load_SSL_strings(void); #define SSL_R_BAD_RSA_MODULUS_LENGTH 121 #define SSL_R_BAD_RSA_SIGNATURE 122 #define SSL_R_BAD_SIGNATURE 123 -#define SSL_R_BAD_SRP_A_LENGTH 2096 -#define SSL_R_BAD_SRP_B_LENGTH 2097 -#define SSL_R_BAD_SRP_G_LENGTH 2098 -#define SSL_R_BAD_SRP_N_LENGTH 2099 -#define SSL_R_BAD_SRP_S_LENGTH 2100 +#define SSL_R_BAD_SRP_A_LENGTH 348 +#define SSL_R_BAD_SRP_B_LENGTH 349 +#define SSL_R_BAD_SRP_G_LENGTH 350 +#define SSL_R_BAD_SRP_N_LENGTH 351 +#define SSL_R_BAD_SRP_S_LENGTH 352 #define SSL_R_BAD_SSL_FILETYPE 124 #define SSL_R_BAD_SSL_SESSION_ID_LENGTH 125 #define SSL_R_BAD_STATE 126 @@ -2247,7 +2247,6 @@ void ERR_load_SSL_strings(void); #define SSL_R_CIPHER_CODE_WRONG_LENGTH 137 #define SSL_R_CIPHER_OR_HASH_UNAVAILABLE 138 #define SSL_R_CIPHER_TABLE_SRC_ERROR 139 -#define SSL_R_CLIENTHELLO_SRP_TLS_EXT 2101 #define SSL_R_CLIENTHELLO_TLSEXT 226 #define SSL_R_COMPRESSED_LENGTH_TOO_LONG 140 #define SSL_R_COMPRESSION_DISABLED 343 @@ -2286,7 +2285,7 @@ void ERR_load_SSL_strings(void); #define SSL_R_INVALID_COMMAND 280 #define SSL_R_INVALID_COMPRESSION_ALGORITHM 341 #define SSL_R_INVALID_PURPOSE 278 -#define SSL_R_INVALID_SRP_USERNAME 2107 +#define SSL_R_INVALID_SRP_USERNAME 353 #define SSL_R_INVALID_STATUS_RESPONSE 328 #define SSL_R_INVALID_TICKET_KEYS_LENGTH 325 #define SSL_R_INVALID_TRUST 279 @@ -2316,8 +2315,8 @@ void ERR_load_SSL_strings(void); #define SSL_R_MISSING_RSA_CERTIFICATE 168 #define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169 #define SSL_R_MISSING_RSA_SIGNING_CERT 170 -#define SSL_R_MISSING_SRP_PARAM 2103 -#define SSL_R_MISSING_SRP_USERNAME 2104 +#define SSL_R_MISSING_SRP_PARAM 354 +#define SSL_R_MISSING_SRP_USERNAME 355 #define SSL_R_MISSING_TMP_DH_KEY 171 #define SSL_R_MISSING_TMP_ECDH_KEY 311 #define SSL_R_MISSING_TMP_RSA_KEY 172 @@ -2390,7 +2389,7 @@ void ERR_load_SSL_strings(void); #define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277 #define SSL_R_SHORT_READ 219 #define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220 -#define SSL_R_SRP_A_CALC 2105 +#define SSL_R_SRP_A_CALC 356 #define SSL_R_SSL23_DOING_SESSION_ID_REUSE 221 #define SSL_R_SSL2_CONNECTION_ID_TOO_LONG 299 #define SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT 321 diff --git a/ssl/ssl_err.c b/ssl/ssl_err.c index 492920c748..f9475db280 100644 --- a/ssl/ssl_err.c +++ b/ssl/ssl_err.c @@ -251,7 +251,7 @@ static ERR_STRING_DATA SSL_str_functs[]= {ERR_FUNC(SSL_F_SSL_SET_TRUST), "SSL_set_trust"}, {ERR_FUNC(SSL_F_SSL_SET_WFD), "SSL_set_wfd"}, {ERR_FUNC(SSL_F_SSL_SHUTDOWN), "SSL_shutdown"}, -{ERR_FUNC(SSL_F_SSL_SRP_CTX_INIT), "SSL_SRP_CTX_INIT"}, +{ERR_FUNC(SSL_F_SSL_SRP_CTX_INIT), "SSL_SRP_CTX_init"}, {ERR_FUNC(SSL_F_SSL_UNDEFINED_CONST_FUNCTION), "SSL_UNDEFINED_CONST_FUNCTION"}, {ERR_FUNC(SSL_F_SSL_UNDEFINED_FUNCTION), "SSL_UNDEFINED_FUNCTION"}, {ERR_FUNC(SSL_F_SSL_UNDEFINED_VOID_FUNCTION), "SSL_UNDEFINED_VOID_FUNCTION"}, @@ -334,7 +334,6 @@ static ERR_STRING_DATA SSL_str_reasons[]= {ERR_REASON(SSL_R_CIPHER_CODE_WRONG_LENGTH),"cipher code wrong length"}, {ERR_REASON(SSL_R_CIPHER_OR_HASH_UNAVAILABLE),"cipher or hash unavailable"}, {ERR_REASON(SSL_R_CIPHER_TABLE_SRC_ERROR),"cipher table src error"}, -{ERR_REASON(SSL_R_CLIENTHELLO_SRP_TLS_EXT),"error with the SRP username"}, {ERR_REASON(SSL_R_CLIENTHELLO_TLSEXT) ,"clienthello tlsext"}, {ERR_REASON(SSL_R_COMPRESSED_LENGTH_TOO_LONG),"compressed length too long"}, {ERR_REASON(SSL_R_COMPRESSION_DISABLED) ,"compression disabled"}, -- 2.25.1