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

Side by Side Diff: nss/lib/util/secoid.c

Issue 1504923011: Update NSS to 3.21 RTM and NSPR to 4.11 RTM (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/nss
Patch Set: Created 5 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* This Source Code Form is subject to the terms of the Mozilla Public 1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 4
5 #include "secoid.h" 5 #include "secoid.h"
6 #include "pkcs11t.h" 6 #include "pkcs11t.h"
7 #include "secitem.h" 7 #include "secitem.h"
8 #include "secerr.h" 8 #include "secerr.h"
9 #include "prenv.h" 9 #include "prenv.h"
10 #include "plhash.h" 10 #include "plhash.h"
11 #include "nssrwlk.h" 11 #include "nssrwlk.h"
12 #include "nssutil.h" 12 #include "nssutil.h"
13 13
14 /* Library identity and versioning */ 14 /* Library identity and versioning */
15 15
16 #if defined(DEBUG) 16 #if defined(DEBUG)
17 #define _DEBUG_STRING " (debug)" 17 #define _DEBUG_STRING " (debug)"
18 #else 18 #else
19 #define _DEBUG_STRING "" 19 #define _DEBUG_STRING ""
20 #endif 20 #endif
21 21
22 /* 22 /*
23 * Version information for the 'ident' and 'what commands 23 * Version information
24 *
25 * NOTE: the first component of the concatenated rcsid string
26 * must not end in a '$' to prevent rcs keyword substitution.
27 */ 24 */
28 const char __nss_util_rcsid[] = "$Header: NSS " NSSUTIL_VERSION _DEBUG_STRING 25 const char __nss_util_version[] = "Version: NSS " NSSUTIL_VERSION _DEBUG_STRING;
29 " " __DATE__ " " __TIME__ " $";
30 const char __nss_util_sccsid[] = "@(#)NSS " NSSUTIL_VERSION _DEBUG_STRING
31 " " __DATE__ " " __TIME__;
32 26
33 /* MISSI Mosaic Object ID space */ 27 /* MISSI Mosaic Object ID space */
34 /* USGov algorithm OID space: { 2 16 840 1 101 } */ 28 /* USGov algorithm OID space: { 2 16 840 1 101 } */
35 #define USGOV 0x60, 0x86, 0x48, 0x01, 0x65 29 #define USGOV 0x60, 0x86, 0x48, 0x01, 0x65
36 #define MISSI USGOV, 0x02, 0x01, 0x01 30 #define MISSI USGOV, 0x02, 0x01, 0x01
37 #define MISSI_OLD_KEA_DSS MISSI, 0x0c 31 #define MISSI_OLD_KEA_DSS MISSI, 0x0c
38 #define MISSI_OLD_DSS MISSI, 0x02 32 #define MISSI_OLD_DSS MISSI, 0x02
39 #define MISSI_KEA_DSS MISSI, 0x14 33 #define MISSI_KEA_DSS MISSI, 0x14
40 #define MISSI_DSS MISSI, 0x13 34 #define MISSI_DSS MISSI, 0x13
41 #define MISSI_KEA MISSI, 0x0a 35 #define MISSI_KEA MISSI, 0x0a
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 CONST_OID aes256_CBC[] = { AES, 42 }; 479 CONST_OID aes256_CBC[] = { AES, 42 };
486 #ifdef DEFINE_ALL_AES_CIPHERS 480 #ifdef DEFINE_ALL_AES_CIPHERS
487 CONST_OID aes256_OFB[] = { AES, 43 }; 481 CONST_OID aes256_OFB[] = { AES, 43 };
488 CONST_OID aes256_CFB[] = { AES, 44 }; 482 CONST_OID aes256_CFB[] = { AES, 44 };
489 #endif 483 #endif
490 CONST_OID aes256_KEY_WRAP[] = { AES, 45 }; 484 CONST_OID aes256_KEY_WRAP[] = { AES, 45 };
491 485
492 CONST_OID camellia128_CBC[] = { CAMELLIA_ENCRYPT_OID, 2}; 486 CONST_OID camellia128_CBC[] = { CAMELLIA_ENCRYPT_OID, 2};
493 CONST_OID camellia192_CBC[] = { CAMELLIA_ENCRYPT_OID, 3}; 487 CONST_OID camellia192_CBC[] = { CAMELLIA_ENCRYPT_OID, 3};
494 CONST_OID camellia256_CBC[] = { CAMELLIA_ENCRYPT_OID, 4}; 488 CONST_OID camellia256_CBC[] = { CAMELLIA_ENCRYPT_OID, 4};
495 CONST_OID camellia128_KEY_WRAP[] = { CAMELLIA_WRAP_OID, 2};
496 CONST_OID camellia192_KEY_WRAP[] = { CAMELLIA_WRAP_OID, 3};
497 CONST_OID camellia256_KEY_WRAP[] = { CAMELLIA_WRAP_OID, 4};
498 489
499 CONST_OID sha256[] = { SHAXXX, 1 }; 490 CONST_OID sha256[] = { SHAXXX, 1 };
500 CONST_OID sha384[] = { SHAXXX, 2 }; 491 CONST_OID sha384[] = { SHAXXX, 2 };
501 CONST_OID sha512[] = { SHAXXX, 3 }; 492 CONST_OID sha512[] = { SHAXXX, 3 };
502 CONST_OID sha224[] = { SHAXXX, 4 }; 493 CONST_OID sha224[] = { SHAXXX, 4 };
503 494
504 CONST_OID ansix962ECPublicKey[] = { ANSI_X962_OID, 0x02, 0x01 }; 495 CONST_OID ansix962ECPublicKey[] = { ANSI_X962_OID, 0x02, 0x01 };
505 CONST_OID ansix962SignaturewithSHA1Digest[] = { ANSI_X962_SIGNATURE_OID, 0x01 }; 496 CONST_OID ansix962SignaturewithSHA1Digest[] = { ANSI_X962_SIGNATURE_OID, 0x01 };
506 CONST_OID ansix962SignatureRecommended[] = { ANSI_X962_SIGNATURE_OID, 0x02 }; 497 CONST_OID ansix962SignatureRecommended[] = { ANSI_X962_SIGNATURE_OID, 0x02 };
507 CONST_OID ansix962SignatureSpecified[] = { ANSI_X962_SPECIFY_OID }; 498 CONST_OID ansix962SignatureSpecified[] = { ANSI_X962_SPECIFY_OID };
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after
1871 } 1862 }
1872 1863
1873 1864
1874 /* normal static table processing */ 1865 /* normal static table processing */
1875 static PLHashTable *oidhash = NULL; 1866 static PLHashTable *oidhash = NULL;
1876 static PLHashTable *oidmechhash = NULL; 1867 static PLHashTable *oidmechhash = NULL;
1877 1868
1878 static PLHashNumber 1869 static PLHashNumber
1879 secoid_HashNumber(const void *key) 1870 secoid_HashNumber(const void *key)
1880 { 1871 {
1881 return (PLHashNumber) key; 1872 return (PLHashNumber)((char *)key - (char *)NULL);
1882 } 1873 }
1883 1874
1884 static void 1875 static void
1885 handleHashAlgSupport(char * envVal) 1876 handleHashAlgSupport(char * envVal)
1886 { 1877 {
1887 char * myVal = PORT_Strdup(envVal); /* Get a copy we can alter */ 1878 char * myVal = PORT_Strdup(envVal); /* Get a copy we can alter */
1888 char * arg = myVal; 1879 char * arg = myVal;
1889 1880
1890 while (arg && *arg) { 1881 while (arg && *arg) {
1891 char * nextArg = PL_strpbrk(arg, ";"); 1882 char * nextArg = PL_strpbrk(arg, ";");
1892 PRUint32 notEnable; 1883 PRUint32 notEnable;
1893 1884
1894 if (nextArg) { 1885 if (nextArg) {
1895 while (*nextArg == ';') { 1886 while (*nextArg == ';') {
1896 *nextArg++ = '\0'; 1887 *nextArg++ = '\0';
1897 } 1888 }
1898 } 1889 }
1899 » notEnable = (*arg == '-') ? NSS_USE_ALG_IN_CERT_SIGNATURE : 0; 1890 » notEnable = (*arg == '-') ? (NSS_USE_ALG_IN_CERT_SIGNATURE|NSS_USE_ALG_I N_SSL_KX) : 0;
1900 if ((*arg == '+' || *arg == '-') && *++arg) { 1891 if ((*arg == '+' || *arg == '-') && *++arg) {
1901 int i; 1892 int i;
1902 1893
1903 for (i = 1; i < SEC_OID_TOTAL; i++) { 1894 for (i = 1; i < SEC_OID_TOTAL; i++) {
1904 if (oids[i].desc && strstr(arg, oids[i].desc)) { 1895 if (oids[i].desc && strstr(arg, oids[i].desc)) {
1905 xOids[i].notPolicyFlags = notEnable | 1896 xOids[i].notPolicyFlags = notEnable |
1906 » » (xOids[i].notPolicyFlags & ~NSS_USE_ALG_IN_CERT_SIGNATURE); 1897 » » (xOids[i].notPolicyFlags & ~(NSS_USE_ALG_IN_CERT_SIGNATURE|N SS_USE_ALG_IN_SSL_KX));
1907 } 1898 }
1908 } 1899 }
1909 } 1900 }
1910 arg = nextArg; 1901 arg = nextArg;
1911 } 1902 }
1912 PORT_Free(myVal); /* can handle NULL argument OK */ 1903 PORT_Free(myVal); /* can handle NULL argument OK */
1913 } 1904 }
1914 1905
1915 SECStatus 1906 SECStatus
1916 SECOID_Init(void) 1907 SECOID_Init(void)
1917 { 1908 {
1918 PLHashEntry *entry; 1909 PLHashEntry *entry;
1919 const SECOidData *oid; 1910 const SECOidData *oid;
1920 int i; 1911 int i;
1921 char * envVal; 1912 char * envVal;
1922 volatile char c; /* force a reference that won't get optimized away */
1923 1913
1924 c = __nss_util_rcsid[0] + __nss_util_sccsid[0]; 1914 #define NSS_VERSION_VARIABLE __nss_util_version
1915 #include "verref.h"
1925 1916
1926 if (oidhash) { 1917 if (oidhash) {
1927 return SECSuccess; /* already initialized */ 1918 return SECSuccess; /* already initialized */
1928 } 1919 }
1929 1920
1930 if (!PR_GetEnv("NSS_ALLOW_WEAK_SIGNATURE_ALG")) { 1921 if (!PR_GetEnv("NSS_ALLOW_WEAK_SIGNATURE_ALG")) {
1931 /* initialize any policy flags that are disabled by default */ 1922 /* initialize any policy flags that are disabled by default */
1932 xOids[SEC_OID_MD2 ].notPolicyFlags = ~0; 1923 xOids[SEC_OID_MD2 ].notPolicyFlags = ~0;
1933 xOids[SEC_OID_MD4 ].notPolicyFlags = ~0; 1924 xOids[SEC_OID_MD4 ].notPolicyFlags = ~0;
1934 xOids[SEC_OID_MD5 ].notPolicyFlags = ~0; 1925 xOids[SEC_OID_MD5 ].notPolicyFlags = ~0;
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
2188 void UTIL_SetForkState(PRBool forked) 2179 void UTIL_SetForkState(PRBool forked)
2189 { 2180 {
2190 parentForkedAfterC_Initialize = forked; 2181 parentForkedAfterC_Initialize = forked;
2191 } 2182 }
2192 2183
2193 const char * 2184 const char *
2194 NSSUTIL_GetVersion(void) 2185 NSSUTIL_GetVersion(void)
2195 { 2186 {
2196 return NSSUTIL_VERSION; 2187 return NSSUTIL_VERSION;
2197 } 2188 }
OLDNEW
« nss/lib/util/pkcs11n.h ('K') | « nss/lib/util/secasn1d.c ('k') | nss/lib/util/secoidt.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698