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

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

Issue 16132005: Allow NSS to be built with NO_NSPR_10_SUPPORT. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « nss/lib/util/quickder.c ('k') | nss/lib/util/secasn1d.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "secder.h" /* XXX remove this when remove the DERTemplate */ 6 #include "secder.h" /* XXX remove this when remove the DERTemplate */
7 #include "secasn1.h" 7 #include "secasn1.h"
8 #include "secitem.h" 8 #include "secitem.h"
9 #include "secerr.h" 9 #include "secerr.h"
10 10
11 SECOidTag 11 SECOidTag
12 SECOID_GetAlgorithmTag(SECAlgorithmID *id) 12 SECOID_GetAlgorithmTag(SECAlgorithmID *id)
13 { 13 {
14 if (id == NULL || id->algorithm.data == NULL) 14 if (id == NULL || id->algorithm.data == NULL)
15 return SEC_OID_UNKNOWN; 15 return SEC_OID_UNKNOWN;
16 16
17 return SECOID_FindOIDTag (&(id->algorithm)); 17 return SECOID_FindOIDTag (&(id->algorithm));
18 } 18 }
19 19
20 SECStatus 20 SECStatus
21 SECOID_SetAlgorithmID(PRArenaPool *arena, SECAlgorithmID *id, SECOidTag which, 21 SECOID_SetAlgorithmID(PLArenaPool *arena, SECAlgorithmID *id, SECOidTag which,
22 SECItem *params) 22 SECItem *params)
23 { 23 {
24 SECOidData *oiddata; 24 SECOidData *oiddata;
25 PRBool add_null_param; 25 PRBool add_null_param;
26 26
27 oiddata = SECOID_FindOIDByTag(which); 27 oiddata = SECOID_FindOIDByTag(which);
28 if ( !oiddata ) { 28 if ( !oiddata ) {
29 PORT_SetError(SEC_ERROR_INVALID_ALGORITHM); 29 PORT_SetError(SEC_ERROR_INVALID_ALGORITHM);
30 return SECFailure; 30 return SECFailure;
31 } 31 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 id->parameters.data[0] = SEC_ASN1_NULL; 91 id->parameters.data[0] = SEC_ASN1_NULL;
92 id->parameters.data[1] = 0; 92 id->parameters.data[1] = 0;
93 } 93 }
94 } 94 }
95 95
96 return SECSuccess; 96 return SECSuccess;
97 } 97 }
98 98
99 SECStatus 99 SECStatus
100 SECOID_CopyAlgorithmID(PRArenaPool *arena, SECAlgorithmID *to, SECAlgorithmID *f rom) 100 SECOID_CopyAlgorithmID(PLArenaPool *arena, SECAlgorithmID *to, SECAlgorithmID *f rom)
101 { 101 {
102 SECStatus rv; 102 SECStatus rv;
103 103
104 rv = SECITEM_CopyItem(arena, &to->algorithm, &from->algorithm); 104 rv = SECITEM_CopyItem(arena, &to->algorithm, &from->algorithm);
105 if (rv) return rv; 105 if (rv) return rv;
106 rv = SECITEM_CopyItem(arena, &to->parameters, &from->parameters); 106 rv = SECITEM_CopyItem(arena, &to->parameters, &from->parameters);
107 return rv; 107 return rv;
108 } 108 }
109 109
110 void SECOID_DestroyAlgorithmID(SECAlgorithmID *algid, PRBool freeit) 110 void SECOID_DestroyAlgorithmID(SECAlgorithmID *algid, PRBool freeit)
111 { 111 {
112 SECITEM_FreeItem(&algid->parameters, PR_FALSE); 112 SECITEM_FreeItem(&algid->parameters, PR_FALSE);
113 SECITEM_FreeItem(&algid->algorithm, PR_FALSE); 113 SECITEM_FreeItem(&algid->algorithm, PR_FALSE);
114 if(freeit == PR_TRUE) 114 if(freeit == PR_TRUE)
115 PORT_Free(algid); 115 PORT_Free(algid);
116 } 116 }
117 117
118 SECComparison 118 SECComparison
119 SECOID_CompareAlgorithmID(SECAlgorithmID *a, SECAlgorithmID *b) 119 SECOID_CompareAlgorithmID(SECAlgorithmID *a, SECAlgorithmID *b)
120 { 120 {
121 SECComparison rv; 121 SECComparison rv;
122 122
123 rv = SECITEM_CompareItem(&a->algorithm, &b->algorithm); 123 rv = SECITEM_CompareItem(&a->algorithm, &b->algorithm);
124 if (rv) return rv; 124 if (rv) return rv;
125 rv = SECITEM_CompareItem(&a->parameters, &b->parameters); 125 rv = SECITEM_CompareItem(&a->parameters, &b->parameters);
126 return rv; 126 return rv;
127 } 127 }
OLDNEW
« no previous file with comments | « nss/lib/util/quickder.c ('k') | nss/lib/util/secasn1d.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698