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

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: Remove the RCS Id from nss-shvfy-const.patch 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,100 @@
+Index: mozilla/security/nss/lib/freebl/pqg.c
+===================================================================
+RCS file: /cvsroot/mozilla/security/nss/lib/freebl/pqg.c,v
+retrieving revision 1.22
+retrieving revision 1.23
+diff -p -u -r1.22 -r1.23
+--- mozilla/security/nss/lib/freebl/pqg.c 22 Sep 2012 15:18:19 -0000 1.22
++++ mozilla/security/nss/lib/freebl/pqg.c 25 Sep 2012 23:38:38 -0000 1.23
+@@ -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: mozilla/security/nss/lib/freebl/rawhash.c
+===================================================================
+RCS file: /cvsroot/mozilla/security/nss/lib/freebl/rawhash.c,v
+retrieving revision 1.10
+retrieving revision 1.11
+diff -p -u -r1.10 -r1.11
+--- mozilla/security/nss/lib/freebl/rawhash.c 26 Jun 2012 22:27:29 -0000 1.10
++++ mozilla/security/nss/lib/freebl/rawhash.c 25 Sep 2012 23:38:38 -0000 1.11
+@@ -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