Граф коммитов

104 Коммитов

Автор SHA1 Сообщение Дата
Tim Taubert 0294a21add Bug 1413841 - Check for integer overflow in AesTask::DoCrypto() r=keeler
Summary:
After calling mResult.SetLength(mData.Length() + 16) we should check that the
integer addition didn't overflow. It seems at the moment impossible to create
ArrayBuffers of size >= 0x0xfffffff0, however adding a check here doesn't hurt.

mResult.Length() is passed to the PK11 API functions as a maxOut parameter and
/should/ be checked by the softoken crypto algorithm implementations. AES-ECB
and AES-GCM seem to do that correctly.

Reviewers: keeler

Reviewed By: keeler

Subscribers: mcote, ttaubert, jcj, keeler

Bug #: 1413841

Differential Revision: https://phabricator.services.mozilla.com/D188
2017-11-28 10:00:47 +01:00
Andrea Marchesini 73712f7d05 Bug 1405290 - Improve logging of workers when shutting down - part 3 - WorkerHolder with names, r=asuth 2017-11-15 07:58:38 +01:00
Andrea Marchesini 351d938b86 Bug 1128959 - Implement the WHATWG Streams spec - part 1 - WebIDL Bindings, r=bz 2017-08-10 18:04:54 -07:00
Bevis Tseng d1637b9c5a Bug 1372453 - Part 2: Name the caller of ProxyReleaseEvent. r=billm
MozReview-Commit-ID: LYhSWnZkq0i
2017-06-14 09:27:17 +08:00
Bill McCloskey aefa2aa5da Bug 1365097 - Convert NS_GetCurrentThread uses in dom (except for dom/media) (r=smaug)
For the Quatum DOM project, it's better to work in terms of event targets than
threads. This patch converts DOM code to operate on event targets rather than
threads, when possible.

MozReview-Commit-ID: 5FgvpKadUA2
2017-06-12 20:20:08 -07:00
Bill McCloskey c197e07ff2 Bug 1363560 - Name more runnables (r=mccr8)
MozReview-Commit-ID: 3hxZDA4JlTV
2017-05-09 21:53:25 -07:00
Cykesiopka 28a88f8f35 Bug 1329238 - Make public CryptoKey.h methods return UniqueX NSS types instead of raw pointers. r=ttaubert
The std::unique_ptr based UniqueX types provide better safety over managing raw
pointers.

MozReview-Commit-ID: EwwOfs6RHqy

--HG--
extra : rebase_source : 7fbfca837c09b641bfffcba854d46b3f79645c0d
2017-01-25 00:27:39 +08:00
Cykesiopka 96938ea780 Bug 1311379 - Stop using Scoped.h NSS types in WebCryptoTask.(cpp|h). r=rbarnes,ttaubert
Scoped.h is deprecated.

MozReview-Commit-ID: CAcnrB9v3dH

--HG--
extra : rebase_source : eaa0dc4348f8577f42c0577d5f9f9031d2d2bb95
2016-11-18 00:49:25 +08:00
Cykesiopka a16f7b0f6a Bug 1296316 - Convert nsNSSShutDownObject::CalledFromType to an enum class. r=mgoodwin
enum classes are in general safer than plain enums, and as such should be
preferred.

MozReview-Commit-ID: 1FK89SNhdk4

--HG--
extra : rebase_source : 764c4855026c02d8c9e33ca33637fec54ea5ca31
2016-08-20 23:00:19 +08:00
Ben Kelly 9d7b33a00b Bug 1293690 P2 Set explicit status levels to fail at when calling WorkerHolder::HoldWorker. r=baku 2016-08-18 07:11:04 -07:00
Phil Ringnalda 4083fafafc Backed out 10 changesets (bug 1290116, bug 1293690) for build bustage
CLOSED TREE

Backed out changeset bbc14d107fca (bug 1290116)
Backed out changeset a81b6ce5c25f (bug 1290116)
Backed out changeset e0b9c25b6125 (bug 1290116)
Backed out changeset 8e9a9ba04ce5 (bug 1290116)
Backed out changeset 2d5ad5e9ed20 (bug 1290116)
Backed out changeset eb7da0dbfc72 (bug 1290116)
Backed out changeset 6a4e8c92faae (bug 1290116)
Backed out changeset 0342d98afa10 (bug 1293690)
Backed out changeset d84b0768f0ce (bug 1293690)
Backed out changeset f9f62ade9508 (bug 1293690)
2016-08-17 21:16:43 -07:00
Ben Kelly fa520e1fdd Bug 1293690 P2 Set explicit status levels to fail at when calling WorkerHolder::HoldWorker. r=baku 2016-08-17 20:01:35 -07:00
Ben Kelly 9c47710e37 Bug 1281874 P1 Hold the worker alive while performing web crypto async work. r=khuey 2016-07-01 06:49:45 -07:00
Cykesiopka 18c21f386e Bug 1271495 - Replace uses of ScopedPK11Context with UniquePK11Context. r=keeler,mcmanus
ScopedPK11Context is based on Scoped.h, which is deprecated in favour of the
standardised UniquePtr.

MozReview-Commit-ID: HE8UY1hOuph

--HG--
extra : transplant_source : 4%BF%81M%09Q-%2A%E6%04%86i%18%1B%3CL%90%88%04%C7
2016-05-13 05:53:57 -07:00
David Keeler cbc656ba88 bug 1271350 - work around PK11_CreatePBEV2AlgorithmID generating a random salt when it shouldn't r=ttaubert
MozReview-Commit-ID: KHjiwPg2SBb

--HG--
extra : rebase_source : b712a557064a6b278f085bac2cbd9bbbc4591c42
2016-05-12 11:12:57 -07:00
Tim Taubert 6fa0b58615 Bug 842818 - Inline CloneData() and clean up ImportKeyTask::SetKeyData() r=rbarnes 2016-03-17 11:02:11 +01:00
Tim Taubert 3d8c7dabb0 Bug 842818 - Allow calling WebCryptoTask::DispatchWithPromise() from workers r=keeler 2016-01-20 23:19:42 +01:00
Tim Taubert 0d2f5760da Bug 1250930 - Use correct global when creating a key in GenerateAsymmetricKeyTask r=bz 2016-03-08 11:15:58 +01:00
Tim Taubert 1551754c99 Bug 1250930 - Use correct global when creating a key in GenerateSymmetricKeyTask r=bz 2016-03-08 11:15:29 +01:00
Tim Taubert 6eec770808 Bug 1250930 - Use SubtleCrypto's global when creating keys for an ImportKeyTask r=bz 2016-03-08 11:14:37 +01:00
Martin Thomson e612132ce4 Bug 1241757 - Permit export of JWK with empty key_ops field, r=rbarnes
--HG--
extra : rebase_source : 65bfd25c8c814a236028ddf611f4a0ef0beb7031
2016-01-22 18:07:39 +11:00
Tim Taubert 49dd294551 Bug 1191936 - Implement SPKI/PKCS#8/JWK import/export for RSA-PSS r=rbarnes 2015-10-14 13:38:05 +02:00
Tim Taubert 38e4db6e5e Bug 1191936 - Implement RSA-PSS signing and verification r=rbarnes,smaug 2015-10-13 20:22:43 +02:00
Tim Taubert ae3b4977e3 Bug 1191936 - Implement RSA-PSS key generation r=rbarnes 2015-10-13 18:48:18 +02:00
Tim Taubert d01d161b5e Bug 1200341 - Implement HKDF for WebCrypto r=rbarnes,smaug 2016-01-26 14:57:52 +01:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Tim Taubert a6c3d80d75 Bug 1213203 - AsymmetricSignVerifyTask::DoCrypto() creates unused SGNContext r=mt 2015-10-09 10:56:55 +02:00
Tim Taubert cd6157491d Bug 1001691 - Make GenerateAsymmetricKeyTask::mKeyPair a UniquePtr so that we can explicitly release it on the main thread r=mt 2015-09-21 14:52:40 +02:00
Tim Taubert 8f64c093bf Bug 1001691 - Use thread pool for WebCrypto operations r=bz 2015-09-11 23:41:58 +02:00
Tim Taubert 7f51dcc335 Bug 1204155 - Check if we're OOM when calling SECKEY_CopyPrivateKey() and SECKEY_CopyPublicKey() r=mt 2015-09-14 11:53:02 +02:00
Tim Taubert 786b045726 Bug 1204155 - Account for OOM in CryptoKey::SetSymKey() r=mt 2015-09-14 11:19:16 +02:00
Martin Thomson 93f1797507 Bug 1172785 - RTCCertificate implementation, r=rbarnes
--HG--
extra : commitid : CBco7h85lO6
extra : rebase_source : 9cec281dd07e6d503a19a0ea57e5d4ceee98197c
2015-07-06 10:40:04 -07:00
Tim Taubert 3b0521bff7 Bug 1169890 - Check return values for CryptoBuffer.Assign() calls r=rbarnes 2015-05-30 08:28:45 +02:00
Birunthan Mohanathas 470bd9148f Bug 968520 - Add mozilla::fallible to FallibleTArray::AppendElements calls. r=froydnj 2015-05-28 11:07:43 -07:00
Birunthan Mohanathas baffd2f6b4 Bug 968520 - Use FallibleTArray::TruncateLength instead of SetLength where possible. r=froydnj
This preemptively fixes the upcoming -Wunused-result warnings due to unchecked
SetLength calls.
2015-05-28 11:07:43 -07:00
Tim Taubert 9a87f6a0e5 Bug 1050175 - Add raw import/export for EC public keys to the WebCrypto API r=rbarnes,smaug 2015-04-28 09:13:16 +02:00
Tim Taubert 43bc9aed8d Bug 1106087 - Recreate newly generated ECDH private keys with an CKA_EC_POINT attribute to support JWK and PKCS8 export r=rbarnes 2015-04-25 14:53:43 +02:00
Tim Taubert fb46a95e93 Bug 1158927 - Calls to CryptoKey::PrivateKeyToPkcs8() and ::PublicKeyToSpki() should check return values r=rbarnes 2015-04-27 20:47:12 +02:00
Andrea Marchesini d2c45be638 Bug 1167423 - patch 6 - Handle return values of FallibleTArray functions in WebCryptTask, r=smaug 2015-05-25 12:50:15 +01:00
Birunthan Mohanathas 735ccdd101 Bug 968520 - Add mozilla::fallible to Fallible{Auto,}TArray::SetLength calls. r=froydnj 2015-05-18 13:50:35 -07:00
Andrew McCreight 9e8f4b219e Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Tim Taubert 1eb44d1229 Bug 1157454 - Satisfy TSan by removing the unneeded mEarlyRv read in WebCryptoTask::CalculateResult() r=rbarnes 2015-04-24 12:05:32 +02:00
Martin Thomson 4c2b709af0 Bug 1158296 - Allow ECDSA key export in WebCrypto, r=rbarnes
--HG--
extra : rebase_source : 40b14fe47652045c063ac40974147b5bfcc91630
2015-04-24 12:56:46 -07:00
Ehsan Akhgari 883849ee32 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Ehsan Akhgari 1889255041 Bug 1118803 - Mark virtual overridden functions as MOZ_OVERRIDE in misc DOM code; r=baku 2015-01-08 08:49:54 -05:00
Guilherme Goncalves 2997c4e001 Bug 1088042 - Fix JsonWebKey object in test_WebCrypto_JWK. r=rbarnes 2014-10-23 09:07:00 +02:00
Tim Taubert 5fa60d8646 Bug 1034856 - Remove CryptoBuffer::ToSECItem() using moz_malloc() r=rbarnes 2014-09-03 09:40:21 -04:00
Tim Taubert 96e8ed9b9a Bug 1034856 - Implement SPKI public key import/export for DH r=rbarnes 2014-08-22 15:32:15 +02:00
Tim Taubert c1d2b2fa82 Bug 1034856 - Implement raw public key import/export for DH r=rbarnes,smaug 2014-08-22 12:02:14 +02:00
Tim Taubert 1d4ba08090 Bug 1034856 - Implement deriveBits() for DH r=rbarnes,smaug 2014-08-21 17:51:51 +02:00