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 #include "cert.h" | 5 #include "cert.h" |
6 #include "secoid.h" | 6 #include "secoid.h" |
7 #include "secder.h" /* XXX remove this when remove the DERTemplates */ | 7 #include "secder.h" /* XXX remove this when remove the DERTemplates */ |
8 #include "secasn1.h" | 8 #include "secasn1.h" |
9 #include "secitem.h" | 9 #include "secitem.h" |
10 #include <stdarg.h> | 10 #include <stdarg.h> |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 if (rv) goto loser; | 233 if (rv) goto loser; |
234 rv = SECITEM_CopyItem(arena, &ava->value, &from->value); | 234 rv = SECITEM_CopyItem(arena, &ava->value, &from->value); |
235 if (rv) goto loser; | 235 if (rv) goto loser; |
236 } | 236 } |
237 return ava; | 237 return ava; |
238 | 238 |
239 loser: | 239 loser: |
240 return 0; | 240 return 0; |
241 } | 241 } |
242 | 242 |
243 /************************************************************************/ | |
244 /* XXX This template needs to go away in favor of the new SEC_ASN1 version. */ | |
245 static const SEC_ASN1Template cert_RDNTemplate[] = { | |
246 { SEC_ASN1_SET_OF, | |
247 offsetof(CERTRDN,avas), cert_AVATemplate, sizeof(CERTRDN) } | |
248 }; | |
249 | |
250 | |
251 CERTRDN * | 243 CERTRDN * |
252 CERT_CreateRDN(PLArenaPool *arena, CERTAVA *ava0, ...) | 244 CERT_CreateRDN(PLArenaPool *arena, CERTAVA *ava0, ...) |
253 { | 245 { |
254 CERTAVA *ava; | 246 CERTAVA *ava; |
255 CERTRDN *rdn; | 247 CERTRDN *rdn; |
256 va_list ap; | 248 va_list ap; |
257 unsigned count; | 249 unsigned count; |
258 CERTAVA **avap; | 250 CERTAVA **avap; |
259 | 251 |
260 rdn = (CERTRDN*) PORT_ArenaAlloc(arena, sizeof(CERTRDN)); | 252 rdn = (CERTRDN*) PORT_ArenaAlloc(arena, sizeof(CERTRDN)); |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 } | 692 } |
701 | 693 |
702 avaValue.data = utf8Val; | 694 avaValue.data = utf8Val; |
703 avaValue.len = utf8ValLen; | 695 avaValue.len = utf8ValLen; |
704 } | 696 } |
705 | 697 |
706 retItem = SECITEM_DupItem(&avaValue); | 698 retItem = SECITEM_DupItem(&avaValue); |
707 PORT_FreeArena(newarena, PR_FALSE); | 699 PORT_FreeArena(newarena, PR_FALSE); |
708 return retItem; | 700 return retItem; |
709 } | 701 } |
OLD | NEW |