瀏覽代碼

Bound EVP_tls_cbc_digest_record at runtime.

This is redundant because these "AEAD"s are not meant to be used outside
of TLS, but since we've moved them into their own layer, they should
check internally.

Change-Id: Ieb3541b2e494902527c2bb56a816cef620cb237b
Reviewed-on: https://boringssl-review.googlesource.com/14310
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
David Benjamin 7 年之前
committed by Adam Langley
父節點
當前提交
053a8f728e
共有 1 個檔案被更改,包括 7 行新增3 行删除
  1. +7
    -3
      crypto/cipher/tls_cbc.c

+ 7
- 3
crypto/cipher/tls_cbc.c 查看文件

@@ -271,9 +271,13 @@ int EVP_tls_cbc_digest_record(const EVP_MD *md, uint8_t *md_out,
* the hash. */
unsigned md_length_size = 8;

/* This is a, hopefully redundant, check that allows us to forget about
* many possible overflows later in this function. */
assert(data_plus_mac_plus_padding_size < 1024 * 1024);
/* Bound the acceptable input so we can forget about many possible overflows
* later in this function. This is redundant with the record size limits in
* TLS. */
if (data_plus_mac_plus_padding_size >= 1024 * 1024) {
assert(0);
return 0;
}

switch (EVP_MD_type(md)) {
case NID_sha1:


Loading…
取消
儲存