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

Unified Diff: mozilla/security/nss/lib/cryptohi/dsautil.c

Issue 10961060: Update NSS to NSS 3.14 Beta 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Add the NSS snapshot timestamp to README.chromium and nss-checkout.sh Created 8 years, 3 months 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
« no previous file with comments | « mozilla/security/nss/lib/cryptohi/cryptohi.h ('k') | mozilla/security/nss/lib/cryptohi/keythi.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mozilla/security/nss/lib/cryptohi/dsautil.c
===================================================================
--- mozilla/security/nss/lib/cryptohi/dsautil.c (revision 158129)
+++ mozilla/security/nss/lib/cryptohi/dsautil.c (working copy)
@@ -6,8 +6,8 @@
#include "secitem.h"
#include "prerr.h"
-#ifndef DSA_SUBPRIME_LEN
-#define DSA_SUBPRIME_LEN 20 /* bytes */
+#ifndef DSA1_SUBPRIME_LEN
+#define DSA1_SUBPRIME_LEN 20 /* bytes */
#endif
typedef struct {
@@ -155,7 +155,7 @@
/* src is a DER-encoded ECDSA or DSA signature.
** Returns a newly-allocated SECItem structure, pointing at a newly allocated
** buffer containing the "raw" signature, which is len bytes of r,
-** followed by len bytes of s. For DSA, len is always DSA_SUBPRIME_LEN.
+** followed by len bytes of s. For DSA, len is the length of q.
** For ECDSA, len depends on the key size used to create the signature.
*/
static SECItem *
@@ -213,14 +213,14 @@
goto done;
}
-/* src is a "raw" DSA signature, 20 bytes of r followed by 20 bytes of s.
+/* src is a "raw" DSA1 signature, 20 bytes of r followed by 20 bytes of s.
** dest is the signature DER encoded. ?
*/
SECStatus
DSAU_EncodeDerSig(SECItem *dest, SECItem *src)
{
- PORT_Assert(src->len == 2 * DSA_SUBPRIME_LEN);
- if (src->len != 2 * DSA_SUBPRIME_LEN) {
+ PORT_Assert(src->len == 2 * DSA1_SUBPRIME_LEN);
+ if (src->len != 2 * DSA1_SUBPRIME_LEN) {
PORT_SetError( PR_INVALID_ARGUMENT_ERROR );
return SECFailure;
}
@@ -246,13 +246,13 @@
/* src is a DER-encoded DSA signature.
** Returns a newly-allocated SECItem structure, pointing at a newly allocated
-** buffer containing the "raw" DSA signature, which is 20 bytes of r,
+** buffer containing the "raw" DSA1 signature, which is 20 bytes of r,
** followed by 20 bytes of s.
*/
SECItem *
DSAU_DecodeDerSig(const SECItem *item)
{
- return common_DecodeDerSig(item, DSA_SUBPRIME_LEN);
+ return common_DecodeDerSig(item, DSA1_SUBPRIME_LEN);
}
/* src is a DER-encoded ECDSA signature.
« no previous file with comments | « mozilla/security/nss/lib/cryptohi/cryptohi.h ('k') | mozilla/security/nss/lib/cryptohi/keythi.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698