Simplify SSL_get0_next_proto_negotiated.

The pointer and length fields should always be kept in sync. Other code
already assumes this anyway.

Change-Id: I62bc77b805cd4d81f2caa4aa49ad3e9d96faa25e
Reviewed-on: https://boringssl-review.googlesource.com/17306
Reviewed-by: Steven Valdez <svaldez@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
This commit is contained in:
David Benjamin 2017-06-21 16:35:10 -04:00 committed by CQ bot account: commit-bot@chromium.org
parent 44c0772c80
commit 05d4c9727f

View File

@ -1714,11 +1714,7 @@ found:
void SSL_get0_next_proto_negotiated(const SSL *ssl, const uint8_t **out_data, void SSL_get0_next_proto_negotiated(const SSL *ssl, const uint8_t **out_data,
unsigned *out_len) { unsigned *out_len) {
*out_data = ssl->s3->next_proto_negotiated; *out_data = ssl->s3->next_proto_negotiated;
if (*out_data == NULL) { *out_len = ssl->s3->next_proto_negotiated_len;
*out_len = 0;
} else {
*out_len = ssl->s3->next_proto_negotiated_len;
}
} }
void SSL_CTX_set_next_protos_advertised_cb( void SSL_CTX_set_next_protos_advertised_cb(