[GCrypt] CryptoKeyRSA: implement create(), keySizeInBits(), buildAlgorithm(), exportData()
Created attachment 307961 [details] Patch
Comment on attachment 307961 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=307961&action=review Looks good. Please wait for Jiewen before committing, as usual. > Source/WebCore/crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:337 > + // dp -- d mod (p - 1) Thank you for the comments. ;) > Source/WebCore/crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:341 > + gcry_mpi_sub_ui(pm1MPI, pm1MPI, 1); Do you think it would be safer to use an extra local variable for the result here (i.e. have both pMPI and pm1MPI locals)? I'm sure this is fine now and probably will be forever, but it could be disastrous if future versions of GCrypt can't handle the first parameter being the same as a subsequent parameter. That's probably paranoid though.
Comment on attachment 307961 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=307961&action=review >> Source/WebCore/crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:341 >> + gcry_mpi_sub_ui(pm1MPI, pm1MPI, 1); > > Do you think it would be safer to use an extra local variable for the result here (i.e. have both pMPI and pm1MPI locals)? I'm sure this is fine now and probably will be forever, but it could be disastrous if future versions of GCrypt can't handle the first parameter being the same as a subsequent parameter. That's probably paranoid though. This makes sense, I think. We could definitely avoid any bug that might manifest in libgcrypt due to aliased pointers being passed to gcry_mpi_*() functions. In this case, all this can be simplified into plain-allocating pm1MPI and then calling gcry_mpi_sub_ui(pm1MPI, pMP1, 1). I'll switch to that.
Created attachment 308219 [details] Patch for landing
Comment on attachment 308219 [details] Patch for landing Clearing flags on attachment: 308219 Committed r215796: <http://trac.webkit.org/changeset/215796>
All reviewed patches have been landed. Closing bug.