Closed
Bug 1025318
Opened 10 years ago
Closed 10 years ago
AesCbcParams should enforce a 16 byte IV length
Categories
(Core :: Security, defect)
Core
Security
Tracking
()
RESOLVED
FIXED
mozilla33
People
(Reporter: ttaubert, Assigned: ttaubert)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
5.94 KB,
patch
|
rbarnes
:
review+
|
Details | Diff | Splinter Review |
dictionary AesCbcParams : Algorithm { // The initialization vector. MUST be 16 bytes. CryptoOperationData iv; }; The length of 16 bytes for "iv" is currently unchecked.
Assignee | ||
Comment 1•10 years ago
|
||
Added tests for AES-CTR as well while I was at it.
Comment 2•10 years ago
|
||
Comment on attachment 8440139 [details] [diff] [review] 0002-Bug-1025318-AesCbcParams-should-enforce-a-16-byte-IV.patch Review of attachment 8440139 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/crypto/WebCryptoTask.cpp @@ +265,5 @@ > return; > } > > ATTEMPT_BUFFER_INIT(mIv, params.mIv.Value()) > + if (mIv.Length() != 16) { It would be marginally more efficient to do this check before assigning to mIv. That is, to check params.mIv.Value().Length(). That way you avoid the copy if you're not going to do anything with it.
Attachment #8440139 -
Flags: review?(rlb) → review+
Assignee | ||
Comment 3•10 years ago
|
||
(In reply to Richard Barnes [:rbarnes] from comment #2) > > ATTEMPT_BUFFER_INIT(mIv, params.mIv.Value()) > > + if (mIv.Length() != 16) { > > It would be marginally more efficient to do this check before assigning to > mIv. That is, to check params.mIv.Value().Length(). That way you avoid the > copy if you're not going to do anything with it. I'll leave this as is as discussed over IRC because we'd have to call GetAsArrayBufferView() or GetAsArrayBuffer() to access the length.
Assignee | ||
Comment 4•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/bcea87ef8d6c
Comment 5•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/bcea87ef8d6c
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in
before you can comment on or make changes to this bug.
Description
•