diff options
author | beck <> | 2017-01-26 12:16:13 +0000 |
---|---|---|
committer | beck <> | 2017-01-26 12:16:13 +0000 |
commit | 5ae189b08474853c519a12e66db1c17cfc3c9c8f (patch) | |
tree | b95866f4795db86411300333c648e4ce8e941899 /src/lib/libssl/ssl_sess.c | |
parent | 10f32610e82e44521c0094ae91acbca090d36a58 (diff) | |
download | openbsd-5ae189b08474853c519a12e66db1c17cfc3c9c8f.tar.gz openbsd-5ae189b08474853c519a12e66db1c17cfc3c9c8f.tar.bz2 openbsd-5ae189b08474853c519a12e66db1c17cfc3c9c8f.zip |
Finish the fallout of the SSLerr->SSLerror cleanup to get rid of the ugly
line wraps that resulted
Diffstat (limited to 'src/lib/libssl/ssl_sess.c')
-rw-r--r-- | src/lib/libssl/ssl_sess.c | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/src/lib/libssl/ssl_sess.c b/src/lib/libssl/ssl_sess.c index 5cd531ef59..5477e9a168 100644 --- a/src/lib/libssl/ssl_sess.c +++ b/src/lib/libssl/ssl_sess.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_sess.c,v 1.68 2017/01/26 10:40:21 beck Exp $ */ | 1 | /* $OpenBSD: ssl_sess.c,v 1.69 2017/01/26 12:16:13 beck Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -312,8 +312,7 @@ ssl_get_new_session(SSL *s, int session) | |||
312 | ss->session_id_length = SSL3_SSL_SESSION_ID_LENGTH; | 312 | ss->session_id_length = SSL3_SSL_SESSION_ID_LENGTH; |
313 | break; | 313 | break; |
314 | default: | 314 | default: |
315 | SSLerror( | 315 | SSLerror(SSL_R_UNSUPPORTED_SSL_VERSION); |
316 | SSL_R_UNSUPPORTED_SSL_VERSION); | ||
317 | SSL_SESSION_free(ss); | 316 | SSL_SESSION_free(ss); |
318 | return (0); | 317 | return (0); |
319 | } | 318 | } |
@@ -336,8 +335,7 @@ ssl_get_new_session(SSL *s, int session) | |||
336 | tmp = ss->session_id_length; | 335 | tmp = ss->session_id_length; |
337 | if (!cb(s, ss->session_id, &tmp)) { | 336 | if (!cb(s, ss->session_id, &tmp)) { |
338 | /* The callback failed */ | 337 | /* The callback failed */ |
339 | SSLerror( | 338 | SSLerror(SSL_R_SSL_SESSION_ID_CALLBACK_FAILED); |
340 | SSL_R_SSL_SESSION_ID_CALLBACK_FAILED); | ||
341 | SSL_SESSION_free(ss); | 339 | SSL_SESSION_free(ss); |
342 | return (0); | 340 | return (0); |
343 | } | 341 | } |
@@ -348,8 +346,7 @@ ssl_get_new_session(SSL *s, int session) | |||
348 | */ | 346 | */ |
349 | if (!tmp || (tmp > ss->session_id_length)) { | 347 | if (!tmp || (tmp > ss->session_id_length)) { |
350 | /* The callback set an illegal length */ | 348 | /* The callback set an illegal length */ |
351 | SSLerror( | 349 | SSLerror(SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH); |
352 | SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH); | ||
353 | SSL_SESSION_free(ss); | 350 | SSL_SESSION_free(ss); |
354 | return (0); | 351 | return (0); |
355 | } | 352 | } |
@@ -358,8 +355,7 @@ ssl_get_new_session(SSL *s, int session) | |||
358 | /* Finally, check for a conflict. */ | 355 | /* Finally, check for a conflict. */ |
359 | if (SSL_has_matching_session_id(s, ss->session_id, | 356 | if (SSL_has_matching_session_id(s, ss->session_id, |
360 | ss->session_id_length)) { | 357 | ss->session_id_length)) { |
361 | SSLerror( | 358 | SSLerror(SSL_R_SSL_SESSION_ID_CONFLICT); |
362 | SSL_R_SSL_SESSION_ID_CONFLICT); | ||
363 | SSL_SESSION_free(ss); | 359 | SSL_SESSION_free(ss); |
364 | return (0); | 360 | return (0); |
365 | } | 361 | } |
@@ -368,8 +364,7 @@ sess_id_done: | |||
368 | if (s->tlsext_hostname) { | 364 | if (s->tlsext_hostname) { |
369 | ss->tlsext_hostname = strdup(s->tlsext_hostname); | 365 | ss->tlsext_hostname = strdup(s->tlsext_hostname); |
370 | if (ss->tlsext_hostname == NULL) { | 366 | if (ss->tlsext_hostname == NULL) { |
371 | SSLerror( | 367 | SSLerror(ERR_R_INTERNAL_ERROR); |
372 | ERR_R_INTERNAL_ERROR); | ||
373 | SSL_SESSION_free(ss); | 368 | SSL_SESSION_free(ss); |
374 | return 0; | 369 | return 0; |
375 | } | 370 | } |
@@ -528,8 +523,7 @@ ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, | |||
528 | * applications to effectively disable the session cache by | 523 | * applications to effectively disable the session cache by |
529 | * accident without anyone noticing). | 524 | * accident without anyone noticing). |
530 | */ | 525 | */ |
531 | SSLerror( | 526 | SSLerror(SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED); |
532 | SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED); | ||
533 | fatal = 1; | 527 | fatal = 1; |
534 | goto err; | 528 | goto err; |
535 | } | 529 | } |
@@ -729,8 +723,7 @@ SSL_set_session(SSL *s, SSL_SESSION *session) | |||
729 | if (meth == NULL) | 723 | if (meth == NULL) |
730 | meth = s->method->internal->get_ssl_method(session->ssl_version); | 724 | meth = s->method->internal->get_ssl_method(session->ssl_version); |
731 | if (meth == NULL) { | 725 | if (meth == NULL) { |
732 | SSLerror( | 726 | SSLerror(SSL_R_UNABLE_TO_FIND_SSL_METHOD); |
733 | SSL_R_UNABLE_TO_FIND_SSL_METHOD); | ||
734 | return (0); | 727 | return (0); |
735 | } | 728 | } |
736 | 729 | ||
@@ -810,8 +803,7 @@ SSL_SESSION_set1_id_context(SSL_SESSION *s, const unsigned char *sid_ctx, | |||
810 | unsigned int sid_ctx_len) | 803 | unsigned int sid_ctx_len) |
811 | { | 804 | { |
812 | if (sid_ctx_len > SSL_MAX_SID_CTX_LENGTH) { | 805 | if (sid_ctx_len > SSL_MAX_SID_CTX_LENGTH) { |
813 | SSLerror( | 806 | SSLerror(SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG); |
814 | SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG); | ||
815 | return 0; | 807 | return 0; |
816 | } | 808 | } |
817 | s->sid_ctx_length = sid_ctx_len; | 809 | s->sid_ctx_length = sid_ctx_len; |
@@ -872,8 +864,7 @@ SSL_set_session_ticket_ext(SSL *s, void *ext_data, int ext_len) | |||
872 | s->internal->tlsext_session_ticket = | 864 | s->internal->tlsext_session_ticket = |
873 | malloc(sizeof(TLS_SESSION_TICKET_EXT) + ext_len); | 865 | malloc(sizeof(TLS_SESSION_TICKET_EXT) + ext_len); |
874 | if (!s->internal->tlsext_session_ticket) { | 866 | if (!s->internal->tlsext_session_ticket) { |
875 | SSLerror( | 867 | SSLerror(ERR_R_MALLOC_FAILURE); |
876 | ERR_R_MALLOC_FAILURE); | ||
877 | return 0; | 868 | return 0; |
878 | } | 869 | } |
879 | 870 | ||
@@ -1080,13 +1071,11 @@ int | |||
1080 | SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e) | 1071 | SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e) |
1081 | { | 1072 | { |
1082 | if (!ENGINE_init(e)) { | 1073 | if (!ENGINE_init(e)) { |
1083 | SSLerror( | 1074 | SSLerror(ERR_R_ENGINE_LIB); |
1084 | ERR_R_ENGINE_LIB); | ||
1085 | return 0; | 1075 | return 0; |
1086 | } | 1076 | } |
1087 | if (!ENGINE_get_ssl_client_cert_function(e)) { | 1077 | if (!ENGINE_get_ssl_client_cert_function(e)) { |
1088 | SSLerror( | 1078 | SSLerror(SSL_R_NO_CLIENT_CERT_METHOD); |
1089 | SSL_R_NO_CLIENT_CERT_METHOD); | ||
1090 | ENGINE_finish(e); | 1079 | ENGINE_finish(e); |
1091 | return 0; | 1080 | return 0; |
1092 | } | 1081 | } |