Test invalid inputs for AES_unwrap_key.
There's an authenticator, so test that AES_unwrap_key notices invalid inputs. Change-Id: Icbb941f91ffd9c91118f956fd74058d241f91ecb Reviewed-on: https://boringssl-review.googlesource.com/13047 Reviewed-by: David Benjamin <davidben@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:
parent
a1eaba1dc6
commit
3fa1e21be4
@ -156,6 +156,13 @@ static bool TestKeyWrap(FileTest *t) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ciphertext[0] ^= 1;
|
||||
if (AES_unwrap_key(&aes_key, nullptr /* iv */, buf.get(), ciphertext.data(),
|
||||
ciphertext.size()) != -1) {
|
||||
t->PrintLine("AES_unwrap_key with bad input unexpectedly succeeded.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user