| 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 /* | 5 /* |
| 6 * Support for various policy related extensions | 6 * Support for various policy related extensions |
| 7 * | 7 * |
| 8 * $Id$ | 8 * $Id$ |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 141 } |
| 142 | 142 |
| 143 curlen++; | 143 curlen++; |
| 144 tmpstr++; | 144 tmpstr++; |
| 145 } | 145 } |
| 146 | 146 |
| 147 return; | 147 return; |
| 148 } | 148 } |
| 149 | 149 |
| 150 CERTCertificatePolicies * | 150 CERTCertificatePolicies * |
| 151 CERT_DecodeCertificatePoliciesExtension(SECItem *extnValue) | 151 CERT_DecodeCertificatePoliciesExtension(const SECItem *extnValue) |
| 152 { | 152 { |
| 153 PRArenaPool *arena = NULL; | 153 PRArenaPool *arena = NULL; |
| 154 SECStatus rv; | 154 SECStatus rv; |
| 155 CERTCertificatePolicies *policies; | 155 CERTCertificatePolicies *policies; |
| 156 CERTPolicyInfo **policyInfos, *policyInfo; | 156 CERTPolicyInfo **policyInfos, *policyInfo; |
| 157 CERTPolicyQualifier **policyQualifiers, *policyQualifier; | 157 CERTPolicyQualifier **policyQualifiers, *policyQualifier; |
| 158 SECItem newExtnValue; | 158 SECItem newExtnValue; |
| 159 | 159 |
| 160 /* make a new arena */ | 160 /* make a new arena */ |
| 161 arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); | 161 arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 { | 274 { |
| 275 if ( mappings != NULL ) { | 275 if ( mappings != NULL ) { |
| 276 PORT_FreeArena(mappings->arena, PR_FALSE); | 276 PORT_FreeArena(mappings->arena, PR_FALSE); |
| 277 } | 277 } |
| 278 return SECSuccess; | 278 return SECSuccess; |
| 279 } | 279 } |
| 280 | 280 |
| 281 SECStatus | 281 SECStatus |
| 282 CERT_DecodePolicyConstraintsExtension | 282 CERT_DecodePolicyConstraintsExtension |
| 283 (CERTCertificatePolicyConstraints *decodedValue, | 283 (CERTCertificatePolicyConstraints *decodedValue, |
| 284 SECItem *encodedValue) | 284 const SECItem *encodedValue) |
| 285 { | 285 { |
| 286 CERTCertificatePolicyConstraints decodeContext; | 286 CERTCertificatePolicyConstraints decodeContext; |
| 287 PRArenaPool *arena = NULL; | 287 PRArenaPool *arena = NULL; |
| 288 SECStatus rv = SECSuccess; | 288 SECStatus rv = SECSuccess; |
| 289 | 289 |
| 290 /* initialize so we can tell when an optional component is omitted */ | 290 /* initialize so we can tell when an optional component is omitted */ |
| 291 PORT_Memset(&decodeContext, 0, sizeof(decodeContext)); | 291 PORT_Memset(&decodeContext, 0, sizeof(decodeContext)); |
| 292 | 292 |
| 293 /* make a new arena */ | 293 /* make a new arena */ |
| 294 arena = PORT_NewArena(SEC_ASN1_DEFAULT_ARENA_SIZE); | 294 arena = PORT_NewArena(SEC_ASN1_DEFAULT_ARENA_SIZE); |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 } | 597 } |
| 598 | 598 |
| 599 | 599 |
| 600 const SEC_ASN1Template CERT_OidSeqTemplate[] = { | 600 const SEC_ASN1Template CERT_OidSeqTemplate[] = { |
| 601 { SEC_ASN1_SEQUENCE_OF | SEC_ASN1_XTRN, | 601 { SEC_ASN1_SEQUENCE_OF | SEC_ASN1_XTRN, |
| 602 offsetof(CERTOidSequence, oids), | 602 offsetof(CERTOidSequence, oids), |
| 603 SEC_ASN1_SUB(SEC_ObjectIDTemplate) } | 603 SEC_ASN1_SUB(SEC_ObjectIDTemplate) } |
| 604 }; | 604 }; |
| 605 | 605 |
| 606 CERTOidSequence * | 606 CERTOidSequence * |
| 607 CERT_DecodeOidSequence(SECItem *seqItem) | 607 CERT_DecodeOidSequence(const SECItem *seqItem) |
| 608 { | 608 { |
| 609 PRArenaPool *arena = NULL; | 609 PRArenaPool *arena = NULL; |
| 610 SECStatus rv; | 610 SECStatus rv; |
| 611 CERTOidSequence *oidSeq; | 611 CERTOidSequence *oidSeq; |
| 612 SECItem newSeqItem; | 612 SECItem newSeqItem; |
| 613 | 613 |
| 614 /* make a new arena */ | 614 /* make a new arena */ |
| 615 arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); | 615 arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); |
| 616 | 616 |
| 617 if ( !arena ) { | 617 if ( !arena ) { |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 if (certInhibitAny == NULL || dest == NULL) { | 819 if (certInhibitAny == NULL || dest == NULL) { |
| 820 return SECFailure; | 820 return SECFailure; |
| 821 } | 821 } |
| 822 | 822 |
| 823 if (SEC_ASN1EncodeItem (arena, dest, certInhibitAny, | 823 if (SEC_ASN1EncodeItem (arena, dest, certInhibitAny, |
| 824 CERT_InhibitAnyTemplate) == NULL) { | 824 CERT_InhibitAnyTemplate) == NULL) { |
| 825 rv = SECFailure; | 825 rv = SECFailure; |
| 826 } | 826 } |
| 827 return(rv); | 827 return(rv); |
| 828 } | 828 } |
| OLD | NEW |