Don't put a colon in the extra error message.
Since the printed format for errors uses colons to separate different parts of the error message, this was confusing. Change-Id: I4742becec2bcb56ad8dc2fdb9a3bb23e4452d1b2 Reviewed-on: https://boringssl-review.googlesource.com/12361 CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> Commit-Queue: Adam Langley <alangley@gmail.com> Commit-Queue: David Benjamin <davidben@google.com> Reviewed-by: David Benjamin <davidben@google.com>
This commit is contained in:
parent
d7b9002aa5
commit
fbbef12918
@ -90,7 +90,7 @@ static int custom_ext_add_hello(SSL *ssl, CBB *extensions) {
|
|||||||
!CBB_add_bytes(&contents_cbb, contents, contents_len) ||
|
!CBB_add_bytes(&contents_cbb, contents, contents_len) ||
|
||||||
!CBB_flush(extensions)) {
|
!CBB_flush(extensions)) {
|
||||||
OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR);
|
OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR);
|
||||||
ERR_add_error_dataf("extension: %u", (unsigned) ext->value);
|
ERR_add_error_dataf("extension %u", (unsigned) ext->value);
|
||||||
if (ext->free_callback && 0 < contents_len) {
|
if (ext->free_callback && 0 < contents_len) {
|
||||||
ext->free_callback(ssl, ext->value, contents, ext->add_arg);
|
ext->free_callback(ssl, ext->value, contents, ext->add_arg);
|
||||||
}
|
}
|
||||||
@ -113,7 +113,7 @@ static int custom_ext_add_hello(SSL *ssl, CBB *extensions) {
|
|||||||
default:
|
default:
|
||||||
ssl3_send_alert(ssl, SSL3_AL_FATAL, alert);
|
ssl3_send_alert(ssl, SSL3_AL_FATAL, alert);
|
||||||
OPENSSL_PUT_ERROR(SSL, SSL_R_CUSTOM_EXTENSION_ERROR);
|
OPENSSL_PUT_ERROR(SSL, SSL_R_CUSTOM_EXTENSION_ERROR);
|
||||||
ERR_add_error_dataf("extension: %u", (unsigned) ext->value);
|
ERR_add_error_dataf("extension %u", (unsigned) ext->value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -136,7 +136,7 @@ int custom_ext_parse_serverhello(SSL *ssl, int *out_alert, uint16_t value,
|
|||||||
/* Also, if we didn't send the extension, that's also unacceptable. */
|
/* Also, if we didn't send the extension, that's also unacceptable. */
|
||||||
!(ssl->s3->hs->custom_extensions.sent & (1u << index))) {
|
!(ssl->s3->hs->custom_extensions.sent & (1u << index))) {
|
||||||
OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION);
|
OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION);
|
||||||
ERR_add_error_dataf("extension: %u", (unsigned)value);
|
ERR_add_error_dataf("extension %u", (unsigned)value);
|
||||||
*out_alert = SSL_AD_UNSUPPORTED_EXTENSION;
|
*out_alert = SSL_AD_UNSUPPORTED_EXTENSION;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -145,7 +145,7 @@ int custom_ext_parse_serverhello(SSL *ssl, int *out_alert, uint16_t value,
|
|||||||
!ext->parse_callback(ssl, value, CBS_data(extension), CBS_len(extension),
|
!ext->parse_callback(ssl, value, CBS_data(extension), CBS_len(extension),
|
||||||
out_alert, ext->parse_arg)) {
|
out_alert, ext->parse_arg)) {
|
||||||
OPENSSL_PUT_ERROR(SSL, SSL_R_CUSTOM_EXTENSION_ERROR);
|
OPENSSL_PUT_ERROR(SSL, SSL_R_CUSTOM_EXTENSION_ERROR);
|
||||||
ERR_add_error_dataf("extension: %u", (unsigned)ext->value);
|
ERR_add_error_dataf("extension %u", (unsigned)ext->value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,7 +169,7 @@ int custom_ext_parse_clienthello(SSL *ssl, int *out_alert, uint16_t value,
|
|||||||
!ext->parse_callback(ssl, value, CBS_data(extension), CBS_len(extension),
|
!ext->parse_callback(ssl, value, CBS_data(extension), CBS_len(extension),
|
||||||
out_alert, ext->parse_arg)) {
|
out_alert, ext->parse_arg)) {
|
||||||
OPENSSL_PUT_ERROR(SSL, SSL_R_CUSTOM_EXTENSION_ERROR);
|
OPENSSL_PUT_ERROR(SSL, SSL_R_CUSTOM_EXTENSION_ERROR);
|
||||||
ERR_add_error_dataf("extension: %u", (unsigned)ext->value);
|
ERR_add_error_dataf("extension %u", (unsigned)ext->value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
ssl/t1_lib.c
12
ssl/t1_lib.c
@ -2651,7 +2651,7 @@ int ssl_add_clienthello_tlsext(SSL *ssl, CBB *out, size_t header_len) {
|
|||||||
const size_t len_before = CBB_len(&extensions);
|
const size_t len_before = CBB_len(&extensions);
|
||||||
if (!kExtensions[i].add_clienthello(ssl, &extensions)) {
|
if (!kExtensions[i].add_clienthello(ssl, &extensions)) {
|
||||||
OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_ADDING_EXTENSION);
|
OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_ADDING_EXTENSION);
|
||||||
ERR_add_error_dataf("extension: %u", (unsigned)kExtensions[i].value);
|
ERR_add_error_dataf("extension %u", (unsigned)kExtensions[i].value);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2744,7 +2744,7 @@ int ssl_add_serverhello_tlsext(SSL *ssl, CBB *out) {
|
|||||||
|
|
||||||
if (!kExtensions[i].add_serverhello(ssl, &extensions)) {
|
if (!kExtensions[i].add_serverhello(ssl, &extensions)) {
|
||||||
OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_ADDING_EXTENSION);
|
OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_ADDING_EXTENSION);
|
||||||
ERR_add_error_dataf("extension: %u", (unsigned)kExtensions[i].value);
|
ERR_add_error_dataf("extension %u", (unsigned)kExtensions[i].value);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2814,7 +2814,7 @@ static int ssl_scan_clienthello_tlsext(
|
|||||||
if (!ext->parse_clienthello(ssl, &alert, &extension)) {
|
if (!ext->parse_clienthello(ssl, &alert, &extension)) {
|
||||||
*out_alert = alert;
|
*out_alert = alert;
|
||||||
OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_PARSING_EXTENSION);
|
OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_PARSING_EXTENSION);
|
||||||
ERR_add_error_dataf("extension: %u", (unsigned)type);
|
ERR_add_error_dataf("extension %u", (unsigned)type);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2842,7 +2842,7 @@ static int ssl_scan_clienthello_tlsext(
|
|||||||
uint8_t alert = SSL_AD_DECODE_ERROR;
|
uint8_t alert = SSL_AD_DECODE_ERROR;
|
||||||
if (!kExtensions[i].parse_clienthello(ssl, &alert, contents)) {
|
if (!kExtensions[i].parse_clienthello(ssl, &alert, contents)) {
|
||||||
OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_EXTENSION);
|
OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_EXTENSION);
|
||||||
ERR_add_error_dataf("extension: %u", (unsigned)kExtensions[i].value);
|
ERR_add_error_dataf("extension %u", (unsigned)kExtensions[i].value);
|
||||||
*out_alert = alert;
|
*out_alert = alert;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -2921,7 +2921,7 @@ static int ssl_scan_serverhello_tlsext(SSL *ssl, CBS *cbs, int *out_alert) {
|
|||||||
uint8_t alert = SSL_AD_DECODE_ERROR;
|
uint8_t alert = SSL_AD_DECODE_ERROR;
|
||||||
if (!ext->parse_serverhello(ssl, &alert, &extension)) {
|
if (!ext->parse_serverhello(ssl, &alert, &extension)) {
|
||||||
OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_PARSING_EXTENSION);
|
OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_PARSING_EXTENSION);
|
||||||
ERR_add_error_dataf("extension: %u", (unsigned)type);
|
ERR_add_error_dataf("extension %u", (unsigned)type);
|
||||||
*out_alert = alert;
|
*out_alert = alert;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -2934,7 +2934,7 @@ static int ssl_scan_serverhello_tlsext(SSL *ssl, CBS *cbs, int *out_alert) {
|
|||||||
uint8_t alert = SSL_AD_DECODE_ERROR;
|
uint8_t alert = SSL_AD_DECODE_ERROR;
|
||||||
if (!kExtensions[i].parse_serverhello(ssl, &alert, NULL)) {
|
if (!kExtensions[i].parse_serverhello(ssl, &alert, NULL)) {
|
||||||
OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_EXTENSION);
|
OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_EXTENSION);
|
||||||
ERR_add_error_dataf("extension: %u", (unsigned)kExtensions[i].value);
|
ERR_add_error_dataf("extension %u", (unsigned)kExtensions[i].value);
|
||||||
*out_alert = alert;
|
*out_alert = alert;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user