From f0ee9079426169c2796ded90db8ba30f6d2eaedb Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Wed, 15 Jun 2016 17:44:37 -0400 Subject: [PATCH] Remove the 'ssl_' prefix on most SSL_PROTOCOL_METHOD hooks. It doesn't really convey anything useful. Leave ssl_get_message alone for now since it's called everywhere in the handshake and I'm about to tweak it further. Change-Id: I6f3a74c170e818f624be8fbe5cf6b796353406df Reviewed-on: https://boringssl-review.googlesource.com/8430 Reviewed-by: Adam Langley --- ssl/d1_pkt.c | 2 +- ssl/handshake_client.c | 2 +- ssl/handshake_server.c | 2 +- ssl/internal.h | 10 +++++----- ssl/s3_pkt.c | 4 ++-- ssl/ssl_lib.c | 8 ++++---- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ssl/d1_pkt.c b/ssl/d1_pkt.c index b821ab31..824a00cf 100644 --- a/ssl/d1_pkt.c +++ b/ssl/d1_pkt.c @@ -362,7 +362,7 @@ int dtls1_write_record(SSL *ssl, int type, const uint8_t *buf, size_t len, /* If we have an alert to send, lets send it */ if (ssl->s3->alert_dispatch) { - int ret = ssl->method->ssl_dispatch_alert(ssl); + int ret = ssl->method->dispatch_alert(ssl); if (ret <= 0) { return ret; } diff --git a/ssl/handshake_client.c b/ssl/handshake_client.c index 3bc27a62..9a3ffa5b 100644 --- a/ssl/handshake_client.c +++ b/ssl/handshake_client.c @@ -463,7 +463,7 @@ int ssl3_connect(SSL *ssl) { break; case SSL3_ST_CR_CHANGE: - ret = ssl->method->ssl_read_change_cipher_spec(ssl); + ret = ssl->method->read_change_cipher_spec(ssl); if (ret <= 0) { goto end; } diff --git a/ssl/handshake_server.c b/ssl/handshake_server.c index 203919c4..6253e968 100644 --- a/ssl/handshake_server.c +++ b/ssl/handshake_server.c @@ -376,7 +376,7 @@ int ssl3_accept(SSL *ssl) { break; case SSL3_ST_SR_CHANGE: - ret = ssl->method->ssl_read_change_cipher_spec(ssl); + ret = ssl->method->read_change_cipher_spec(ssl); if (ret <= 0) { goto end; } diff --git a/ssl/internal.h b/ssl/internal.h index 457a8b42..da4ad873 100644 --- a/ssl/internal.h +++ b/ssl/internal.h @@ -813,11 +813,11 @@ struct ssl_protocol_method_st { void (*ssl_free)(SSL *ssl); long (*ssl_get_message)(SSL *ssl, int msg_type, enum ssl_hash_message_t hash_message, int *ok); - int (*ssl_read_app_data)(SSL *ssl, uint8_t *buf, int len, int peek); - int (*ssl_read_change_cipher_spec)(SSL *ssl); - void (*ssl_read_close_notify)(SSL *ssl); - int (*ssl_write_app_data)(SSL *ssl, const void *buf_, int len); - int (*ssl_dispatch_alert)(SSL *ssl); + int (*read_app_data)(SSL *ssl, uint8_t *buf, int len, int peek); + int (*read_change_cipher_spec)(SSL *ssl); + void (*read_close_notify)(SSL *ssl); + int (*write_app_data)(SSL *ssl, const void *buf_, int len); + int (*dispatch_alert)(SSL *ssl); /* supports_cipher returns one if |cipher| is supported by this protocol and * zero otherwise. */ int (*supports_cipher)(const SSL_CIPHER *cipher); diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c index 2396a7fd..1bbed597 100644 --- a/ssl/s3_pkt.c +++ b/ssl/s3_pkt.c @@ -268,7 +268,7 @@ static int do_ssl3_write(SSL *ssl, int type, const uint8_t *buf, unsigned len) { /* If we have an alert to send, lets send it */ if (ssl->s3->alert_dispatch) { - int ret = ssl->method->ssl_dispatch_alert(ssl); + int ret = ssl->method->dispatch_alert(ssl); if (ret <= 0) { return ret; } @@ -529,7 +529,7 @@ int ssl3_send_alert(SSL *ssl, int level, int desc) { if (!ssl_write_buffer_is_pending(ssl)) { /* Nothing is being written out, so the alert may be dispatched * immediately. */ - return ssl->method->ssl_dispatch_alert(ssl); + return ssl->method->dispatch_alert(ssl); } /* The alert will be dispatched later. */ diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 5da339d0..a7070d10 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -642,7 +642,7 @@ static int ssl_read_impl(SSL *ssl, void *buf, int num, int peek) { } } - return ssl->method->ssl_read_app_data(ssl, buf, num, peek); + return ssl->method->read_app_data(ssl, buf, num, peek); } int SSL_read(SSL *ssl, void *buf, int num) { @@ -681,7 +681,7 @@ int SSL_write(SSL *ssl, const void *buf, int num) { } } - return ssl->method->ssl_write_app_data(ssl, buf, num); + return ssl->method->write_app_data(ssl, buf, num); } int SSL_shutdown(SSL *ssl) { @@ -719,12 +719,12 @@ int SSL_shutdown(SSL *ssl) { } } else if (ssl->s3->alert_dispatch) { /* Finish sending the close_notify. */ - if (ssl->method->ssl_dispatch_alert(ssl) <= 0) { + if (ssl->method->dispatch_alert(ssl) <= 0) { return -1; } } else if (ssl->s3->recv_shutdown != ssl_shutdown_close_notify) { /* Wait for the peer's close_notify. */ - ssl->method->ssl_read_close_notify(ssl); + ssl->method->read_close_notify(ssl); if (ssl->s3->recv_shutdown != ssl_shutdown_close_notify) { return -1; }