Keep the patch as it was approved with only the recommended changes.

- Revert back to using szOID_KP_CTL_USAGE_SIGNING instead of SEC_OID_KP_CTL_USAGE_SIGNING
- This is our temporary local private name and what makes this code work even after we rebase
- and pick up the upstream changes. Of course, this patch will be removed when that happens.
This commit is contained in:
Elio Maldonado 2012-11-20 09:42:53 -08:00
parent 6e1a26a079
commit e45858c07c

View File

@ -24,7 +24,7 @@ diff -up ./mozilla/security/nss/cmd/certcgi/certcgi.c.870864 ./mozilla/security/
static char *progName;
+extern SECOidTag SEC_OID_KP_CTL_USAGE_SIGNING;
+extern SECOidTag szOID_KP_CTL_USAGE_SIGNING;
+
typedef struct PairStr Pair;
@ -60,7 +60,7 @@ diff -up ./mozilla/security/nss/cmd/certutil/certext.c.870864 ./mozilla/security
#include "secutil.h"
+/* #include "secoidt.h" */ /* For when we update nss */
+
+extern SECOidTag SEC_OID_KP_CTL_USAGE_SIGNING;
+extern SECOidTag szOID_KP_CTL_USAGE_SIGNING;
#if defined(XP_UNIX)
#include <unistd.h>
@ -77,7 +77,7 @@ diff -up ./mozilla/security/nss/cmd/certutil/certext.c.870864 ./mozilla/security
rv = AddOidToSequence(os, SEC_OID_NS_KEY_USAGE_GOVT_APPROVED);
break;
+ case 7:
+ rv = AddOidToSequence(os, SEC_OID_KP_CTL_USAGE_SIGNING);
+ rv = AddOidToSequence(os, szOID_KP_CTL_USAGE_SIGNING);
+ break;
default:
goto endloop;
@ -111,7 +111,7 @@ diff -up ./mozilla/security/nss/cmd/lib/moreoids.c.870864 ./mozilla/security/nss
+#define _TO_ITEM(x) {siDEROID, (unsigned char *)(x), sizeof(x) }
+
+SECOidTag SEC_OID_KP_CTL_USAGE_SIGNING = SEC_OID_UNKNOWN;
+SECOidTag szOID_KP_CTL_USAGE_SIGNING = SEC_OID_UNKNOWN;
+/* { 1.3.6.1.4.1.311 } */
+static const unsigned char msExtendedKeyUsageCodeSigning[] =
+ { 0x2b, 0x6, 0x1, 0x4, 0x1, 0x82, 0x37, 0xa, 3, 1 };
@ -149,7 +149,7 @@ diff -up ./mozilla/security/nss/cmd/lib/moreoids.c.870864 ./mozilla/security/nss
}
+
+ /* Fetch and register the oid on behalf of the tools. */
+ SECU_cert_fetchOID(&SEC_OID_KP_CTL_USAGE_SIGNING,
+ SECU_cert_fetchOID(&szOID_KP_CTL_USAGE_SIGNING,
+ &microsoftAuthenticodeSigning_Entry);
+
return rv;