Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 1520459 - Send decode_error for padded record_size_limit extensio…
…n, r=jcj

Summary: This is all I plan to do for this bug.

Reviewers: jcj

Tags: #secure-revision

Bug #: 1520459

Differential Revision: https://phabricator.services.mozilla.com/D19576

--HG--
extra : amend_source : cbc830e8861fb691b0500b773a96b8dc24db4fab
  • Loading branch information
martinthomson committed Feb 12, 2019
1 parent dfb6133 commit 6efd143
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions gtests/ssl_gtest/ssl_recordsize_unittest.cc
Expand Up @@ -397,6 +397,16 @@ TEST_P(TlsConnectGeneric, RecordSizeServerExtensionInvalid) {
ConnectExpectAlert(client_, kTlsAlertIllegalParameter);
}

TEST_P(TlsConnectGeneric, RecordSizeServerExtensionExtra) {
EnsureTlsSetup();
server_->SetOption(SSL_RECORD_SIZE_LIMIT, 1000);
static const uint8_t v[] = {0x01, 0x00, 0x00};
auto replace = MakeTlsFilter<TlsExtensionReplacer>(
server_, ssl_record_size_limit_xtn, DataBuffer(v, sizeof(v)));
replace->EnableDecryption();
ConnectExpectAlert(client_, kTlsAlertDecodeError);
}

class RecordSizeDefaultsTest : public ::testing::Test {
public:
void SetUp() {
Expand Down
2 changes: 1 addition & 1 deletion lib/ssl/ssl3exthandle.c
Expand Up @@ -1927,7 +1927,7 @@ ssl_HandleRecordSizeLimitXtn(const sslSocket *ss, TLSExtensionData *xtnData,
return SECFailure;
}
if (data->len != 0 || limit < 64) {
ssl3_ExtSendAlert(ss, alert_fatal, illegal_parameter);
ssl3_ExtSendAlert(ss, alert_fatal, decode_error);
PORT_SetError(SSL_ERROR_RX_MALFORMED_HANDSHAKE);
return SECFailure;
}
Expand Down

0 comments on commit 6efd143

Please sign in to comment.