Bug 1286059 - throw correct error when encrypting with a bad AES-GCM tag length r=keeler

Differential Revision: https://phabricator.services.mozilla.com/D81144
This commit is contained in:
R. Martinho Fernandes 2020-07-06 16:43:54 +00:00
Родитель 8ec8f43e46
Коммит 674dd4c80f
3 изменённых файлов: 2 добавлений и 220 удалений

Просмотреть файл

@ -535,7 +535,7 @@ class AesTask : public ReturnArrayBufferViewTask, public DeferredData {
RootedDictionary<AesGcmParams> params(aCx);
nsresult rv = Coerce(aCx, params, aAlgorithm);
if (NS_FAILED(rv)) {
mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR;
mEarlyRv = NS_ERROR_DOM_OPERATION_ERR;
return;
}
@ -552,7 +552,7 @@ class AesTask : public ReturnArrayBufferViewTask, public DeferredData {
if ((mTagLength > 128) ||
!(mTagLength == 32 || mTagLength == 64 ||
(mTagLength >= 96 && mTagLength % 8 == 0))) {
mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR;
mEarlyRv = NS_ERROR_DOM_OPERATION_ERR;
return;
}
}

Просмотреть файл

@ -1,109 +0,0 @@
[aes_gcm.https.worker.html]
[AES-GCM 128-bit key, illegal tag length 24-bits]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 48-bits]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 72-bits]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 95-bits]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 129-bits]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 256-bits]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 24-bits]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 48-bits]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 72-bits]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 95-bits]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 129-bits]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 256-bits]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 24-bits]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 48-bits]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 72-bits]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 95-bits]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 129-bits]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 256-bits]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 24-bits decryption]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 48-bits decryption]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 72-bits decryption]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 95-bits decryption]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 129-bits decryption]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 256-bits decryption]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 24-bits decryption]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 48-bits decryption]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 72-bits decryption]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 95-bits decryption]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 129-bits decryption]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 256-bits decryption]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 24-bits decryption]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 48-bits decryption]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 72-bits decryption]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 95-bits decryption]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 129-bits decryption]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 256-bits decryption]
expected: FAIL

Просмотреть файл

@ -1,109 +0,0 @@
[test_aes_gcm.https.html]
[AES-GCM 128-bit key, illegal tag length 24-bits]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 48-bits]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 72-bits]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 95-bits]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 129-bits]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 256-bits]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 24-bits]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 48-bits]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 72-bits]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 95-bits]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 129-bits]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 256-bits]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 24-bits]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 48-bits]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 72-bits]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 95-bits]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 129-bits]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 256-bits]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 24-bits decryption]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 48-bits decryption]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 72-bits decryption]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 95-bits decryption]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 129-bits decryption]
expected: FAIL
[AES-GCM 128-bit key, illegal tag length 256-bits decryption]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 24-bits decryption]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 48-bits decryption]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 72-bits decryption]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 95-bits decryption]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 129-bits decryption]
expected: FAIL
[AES-GCM 192-bit key, illegal tag length 256-bits decryption]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 24-bits decryption]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 48-bits decryption]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 72-bits decryption]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 95-bits decryption]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 129-bits decryption]
expected: FAIL
[AES-GCM 256-bit key, illegal tag length 256-bits decryption]
expected: FAIL