Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1543)

Unified Diff: patches/nss-pqg-sechash.patch

Issue 11359091: Update NSS to NSS 3.14 pre-release snapshot 2012-06-26 01:00:00 PDT. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: patches/nss-pqg-sechash.patch
===================================================================
--- patches/nss-pqg-sechash.patch (revision 0)
+++ patches/nss-pqg-sechash.patch (revision 0)
@@ -0,0 +1,98 @@
+Index: pqg.c
+===================================================================
+RCS file: /cvsroot/mozilla/security/nss/lib/freebl/pqg.c,v
+retrieving revision 1.21
+diff -p -u -r1.21 pqg.c
+--- pqg.c 25 Jun 2012 17:30:17 -0000 1.21
++++ pqg.c 22 Sep 2012 14:41:57 -0000
+@@ -21,7 +21,6 @@
+ #include "mpprime.h"
+ #include "mplogic.h"
+ #include "secmpi.h"
+-#include "sechash.h"
+
+ #define MAX_ITERATIONS 1000 /* Maximum number of iterations of primegen */
+
+@@ -152,6 +151,38 @@ getNextHash(HASH_HashType hashtype)
+ return hashtype;
+ }
+
++static unsigned int
++HASH_ResultLen(HASH_HashType type)
++{
++ const SECHashObject *hash_obj = HASH_GetRawHashObject(type);
++ if (hash_obj == NULL) {
++ return 0;
++ }
++ return hash_obj->length;
++}
++
++static SECStatus
++HASH_HashBuf(HASH_HashType type, unsigned char *dest,
++ const unsigned char *src, PRUint32 src_len)
++{
++ const SECHashObject *hash_obj = HASH_GetRawHashObject(type);
++ void *hashcx = NULL;
++ unsigned int dummy;
++
++ if (hash_obj == NULL) {
++ return SECFailure;
++ }
++
++ hashcx = hash_obj->create();
++ if (hashcx == NULL) {
++ return SECFailure;
++ }
++ hash_obj->begin(hashcx);
++ hash_obj->update(hashcx,src,src_len);
++ hash_obj->end(hashcx,dest, &dummy, hash_obj->length);
++ hash_obj->destroy(hashcx, PR_TRUE);
++ return SECSuccess;
++}
+
+ unsigned int
+ PQG_GetLength(const SECItem *obj)
+Index: rawhash.c
+===================================================================
+RCS file: /cvsroot/mozilla/security/nss/lib/freebl/rawhash.c,v
+retrieving revision 1.10
+diff -p -u -r1.10 rawhash.c
+--- rawhash.c 26 Jun 2012 22:27:29 -0000 1.10
++++ rawhash.c 22 Sep 2012 14:41:57 -0000
+@@ -145,36 +145,3 @@ HASH_GetRawHashObject(HASH_HashType hash
+ }
+ return &SECRawHashObjects[hashType];
+ }
+-
+-unsigned int
+-HASH_ResultLen(HASH_HashType type)
+-{
+- const SECHashObject *hash_obj = HASH_GetRawHashObject(type);
+- if (hash_obj == NULL) {
+- return 0;
+- }
+- return hash_obj->length;
+-}
+-
+-SECStatus
+-HASH_HashBuf(HASH_HashType type, unsigned char *dest,
+- const unsigned char *src, PRUint32 src_len)
+-{
+- const SECHashObject *hash_obj = HASH_GetRawHashObject(type);
+- void *hashcx = NULL;
+- unsigned int dummy;
+-
+- if (hash_obj == NULL) {
+- return SECFailure;
+- }
+-
+- hashcx = hash_obj->create();
+- if (hashcx == NULL) {
+- return SECFailure;
+- }
+- hash_obj->begin(hashcx);
+- hash_obj->update(hashcx,src,src_len);
+- hash_obj->end(hashcx,dest, &dummy, hash_obj->length);
+- hash_obj->destroy(hashcx, PR_TRUE);
+- return SECSuccess;
+-}

Powered by Google App Engine
This is Rietveld 408576698