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

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

Issue 70673004: Update to NSS 3.15.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Update to NSS 3.15.3 Created 7 years, 1 month 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 "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(const 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(PLArenaPool *arena, SECAlgorithmID *id, SECOidTag which, 21 SECOID_SetAlgorithmID(PLArenaPool *arena, SECAlgorithmID *id, SECOidTag which,
22 SECItem *params) 22 SECItem *params)
(...skipping 67 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(PLArenaPool *arena, SECAlgorithmID *to, SECAlgorithmID *f rom) 100 SECOID_CopyAlgorithmID(PLArenaPool *arena, SECAlgorithmID *to,
101 const SECAlgorithmID *from)
101 { 102 {
102 SECStatus rv; 103 SECStatus rv;
103 104
104 rv = SECITEM_CopyItem(arena, &to->algorithm, &from->algorithm); 105 rv = SECITEM_CopyItem(arena, &to->algorithm, &from->algorithm);
105 if (rv) return rv; 106 if (rv) return rv;
106 rv = SECITEM_CopyItem(arena, &to->parameters, &from->parameters); 107 rv = SECITEM_CopyItem(arena, &to->parameters, &from->parameters);
107 return rv; 108 return rv;
108 } 109 }
109 110
110 void SECOID_DestroyAlgorithmID(SECAlgorithmID *algid, PRBool freeit) 111 void SECOID_DestroyAlgorithmID(SECAlgorithmID *algid, PRBool freeit)
111 { 112 {
112 SECITEM_FreeItem(&algid->parameters, PR_FALSE); 113 SECITEM_FreeItem(&algid->parameters, PR_FALSE);
113 SECITEM_FreeItem(&algid->algorithm, PR_FALSE); 114 SECITEM_FreeItem(&algid->algorithm, PR_FALSE);
114 if(freeit == PR_TRUE) 115 if(freeit == PR_TRUE)
115 PORT_Free(algid); 116 PORT_Free(algid);
116 } 117 }
117 118
118 SECComparison 119 SECComparison
119 SECOID_CompareAlgorithmID(SECAlgorithmID *a, SECAlgorithmID *b) 120 SECOID_CompareAlgorithmID(SECAlgorithmID *a, SECAlgorithmID *b)
120 { 121 {
121 SECComparison rv; 122 SECComparison rv;
122 123
123 rv = SECITEM_CompareItem(&a->algorithm, &b->algorithm); 124 rv = SECITEM_CompareItem(&a->algorithm, &b->algorithm);
124 if (rv) return rv; 125 if (rv) return rv;
125 rv = SECITEM_CompareItem(&a->parameters, &b->parameters); 126 rv = SECITEM_CompareItem(&a->parameters, &b->parameters);
126 return rv; 127 return rv;
127 } 128 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698