| OLD | NEW |
| 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 * The following code handles the storage of PKCS 11 modules used by the | 5 * The following code handles the storage of PKCS 11 modules used by the |
| 6 * NSS. This file is written to abstract away how the modules are | 6 * NSS. This file is written to abstract away how the modules are |
| 7 * stored so we can decide that later. | 7 * stored so we can decide that later. |
| 8 */ | 8 */ |
| 9 #include "secport.h" | 9 #include "secport.h" |
| 10 #include "prprf.h" | 10 #include "prprf.h" |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 * make a new slot specific parameter | 670 * make a new slot specific parameter |
| 671 */ | 671 */ |
| 672 /* first make the slot flags */ | 672 /* first make the slot flags */ |
| 673 static char * | 673 static char * |
| 674 nssutil_mkSlotFlags(unsigned long defaultFlags) | 674 nssutil_mkSlotFlags(unsigned long defaultFlags) |
| 675 { | 675 { |
| 676 char *flags=NULL; | 676 char *flags=NULL; |
| 677 int i,j; | 677 int i,j; |
| 678 | 678 |
| 679 for (i=0; i < sizeof(defaultFlags)*8; i++) { | 679 for (i=0; i < sizeof(defaultFlags)*8; i++) { |
| 680 » if (defaultFlags & (1<<i)) { | 680 » if (defaultFlags & (1UL <<i)) { |
| 681 char *string = NULL; | 681 char *string = NULL; |
| 682 | 682 |
| 683 for (j=0; j < nssutil_argSlotFlagTableSize; j++) { | 683 for (j=0; j < nssutil_argSlotFlagTableSize; j++) { |
| 684 if (nssutil_argSlotFlagTable[j].value == ( 1UL << i )) { | 684 if (nssutil_argSlotFlagTable[j].value == ( 1UL << i )) { |
| 685 string = nssutil_argSlotFlagTable[j].name; | 685 string = nssutil_argSlotFlagTable[j].name; |
| 686 break; | 686 break; |
| 687 } | 687 } |
| 688 } | 688 } |
| 689 if (string) { | 689 if (string) { |
| 690 if (flags) { | 690 if (flags) { |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 | 882 |
| 883 | 883 |
| 884 /* construct the NSS cipher flags */ | 884 /* construct the NSS cipher flags */ |
| 885 static char * | 885 static char * |
| 886 nssutil_mkCipherFlags(unsigned long ssl0, unsigned long ssl1) | 886 nssutil_mkCipherFlags(unsigned long ssl0, unsigned long ssl1) |
| 887 { | 887 { |
| 888 char *cipher = NULL; | 888 char *cipher = NULL; |
| 889 int i; | 889 int i; |
| 890 | 890 |
| 891 for (i=0; i < sizeof(ssl0)*8; i++) { | 891 for (i=0; i < sizeof(ssl0)*8; i++) { |
| 892 » if (ssl0 & (1<<i)) { | 892 » if (ssl0 & (1UL <<i)) { |
| 893 char *string; | 893 char *string; |
| 894 » if ((1<<i) == SECMOD_FORTEZZA_FLAG) { | 894 » if ((1UL <<i) == SECMOD_FORTEZZA_FLAG) { |
| 895 string = PR_smprintf("%s",NSSUTIL_ARG_FORTEZZA_FLAG); | 895 string = PR_smprintf("%s",NSSUTIL_ARG_FORTEZZA_FLAG); |
| 896 } else { | 896 } else { |
| 897 » » string = PR_smprintf("0h0x%08x",1<<i); | 897 » » string = PR_smprintf("0h0x%08lx", 1UL <<i); |
| 898 } | 898 } |
| 899 if (cipher) { | 899 if (cipher) { |
| 900 char *tmp; | 900 char *tmp; |
| 901 tmp = PR_smprintf("%s,%s",cipher,string); | 901 tmp = PR_smprintf("%s,%s",cipher,string); |
| 902 PR_smprintf_free(cipher); | 902 PR_smprintf_free(cipher); |
| 903 PR_smprintf_free(string); | 903 PR_smprintf_free(string); |
| 904 cipher = tmp; | 904 cipher = tmp; |
| 905 } else { | 905 } else { |
| 906 cipher = string; | 906 cipher = string; |
| 907 } | 907 } |
| 908 } | 908 } |
| 909 } | 909 } |
| 910 for (i=0; i < sizeof(ssl0)*8; i++) { | 910 for (i=0; i < sizeof(ssl0)*8; i++) { |
| 911 » if (ssl1 & (1<<i)) { | 911 » if (ssl1 & (1UL <<i)) { |
| 912 if (cipher) { | 912 if (cipher) { |
| 913 char *tmp; | 913 char *tmp; |
| 914 » » tmp = PR_smprintf("%s,0l0x%08x",cipher,1<<i); | 914 » » tmp = PR_smprintf("%s,0l0x%08lx",cipher, 1UL <<i); |
| 915 PR_smprintf_free(cipher); | 915 PR_smprintf_free(cipher); |
| 916 cipher = tmp; | 916 cipher = tmp; |
| 917 } else { | 917 } else { |
| 918 » » cipher = PR_smprintf("0l0x%08x",1<<i); | 918 » » cipher = PR_smprintf("0l0x%08lx", 1UL <<i); |
| 919 } | 919 } |
| 920 } | 920 } |
| 921 } | 921 } |
| 922 | 922 |
| 923 return cipher; | 923 return cipher; |
| 924 } | 924 } |
| 925 | 925 |
| 926 /* Assemble a full NSS string. */ | 926 /* Assemble a full NSS string. */ |
| 927 char * | 927 char * |
| 928 NSSUTIL_MkNSSString(char **slotStrings, int slotCount, PRBool internal, | 928 NSSUTIL_MkNSSString(char **slotStrings, int slotCount, PRBool internal, |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1108 value = PR_smprintf("%s" NSSUTIL_PATH_SEPARATOR "%s", | 1108 value = PR_smprintf("%s" NSSUTIL_PATH_SEPARATOR "%s", |
| 1109 lconfigdir,secmodName); | 1109 lconfigdir,secmodName); |
| 1110 } else { | 1110 } else { |
| 1111 value = PR_smprintf("%s",secmodName); | 1111 value = PR_smprintf("%s",secmodName); |
| 1112 } | 1112 } |
| 1113 if (configdir) PORT_Free(configdir); | 1113 if (configdir) PORT_Free(configdir); |
| 1114 return value; | 1114 return value; |
| 1115 } | 1115 } |
| 1116 | 1116 |
| 1117 | 1117 |
| OLD | NEW |