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 * X.509 v3 Subject Key Usage Extension | 6 * X.509 v3 Subject Key Usage Extension |
7 * | 7 * |
8 */ | 8 */ |
9 | 9 |
10 #include "prtypes.h" | 10 #include "prtypes.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 { SEC_ASN1_OPTIONAL | SEC_ASN1_CONSTRUCTED | SEC_ASN1_CONTEXT_SPECIFIC | 1, | 28 { SEC_ASN1_OPTIONAL | SEC_ASN1_CONSTRUCTED | SEC_ASN1_CONTEXT_SPECIFIC | 1, |
29 offsetof(CERTAuthKeyID, DERAuthCertIssuer), CERT_GeneralNamesTemplate}
, | 29 offsetof(CERTAuthKeyID, DERAuthCertIssuer), CERT_GeneralNamesTemplate}
, |
30 { SEC_ASN1_OPTIONAL | SEC_ASN1_CONTEXT_SPECIFIC | SEC_ASN1_XTRN | 2, | 30 { SEC_ASN1_OPTIONAL | SEC_ASN1_CONTEXT_SPECIFIC | SEC_ASN1_XTRN | 2, |
31 offsetof(CERTAuthKeyID,authCertSerialNumber), | 31 offsetof(CERTAuthKeyID,authCertSerialNumber), |
32 SEC_ASN1_SUB(SEC_IntegerTemplate) }, | 32 SEC_ASN1_SUB(SEC_IntegerTemplate) }, |
33 { 0 } | 33 { 0 } |
34 }; | 34 }; |
35 | 35 |
36 | 36 |
37 | 37 |
38 SECStatus CERT_EncodeAuthKeyID (PRArenaPool *arena, CERTAuthKeyID *value, SECIte
m *encodedValue) | 38 SECStatus CERT_EncodeAuthKeyID (PLArenaPool *arena, CERTAuthKeyID *value, SECIte
m *encodedValue) |
39 { | 39 { |
40 SECStatus rv = SECFailure; | 40 SECStatus rv = SECFailure; |
41 | 41 |
42 PORT_Assert (value); | 42 PORT_Assert (value); |
43 PORT_Assert (arena); | 43 PORT_Assert (arena); |
44 PORT_Assert (value->DERAuthCertIssuer == NULL); | 44 PORT_Assert (value->DERAuthCertIssuer == NULL); |
45 PORT_Assert (encodedValue); | 45 PORT_Assert (encodedValue); |
46 | 46 |
47 do { | 47 do { |
48 | 48 |
(...skipping 22 matching lines...) Expand all Loading... |
71 if (SEC_ASN1EncodeItem (arena, encodedValue, value, | 71 if (SEC_ASN1EncodeItem (arena, encodedValue, value, |
72 CERTAuthKeyIDTemplate) == NULL) | 72 CERTAuthKeyIDTemplate) == NULL) |
73 break; | 73 break; |
74 rv = SECSuccess; | 74 rv = SECSuccess; |
75 | 75 |
76 } while (0); | 76 } while (0); |
77 return(rv); | 77 return(rv); |
78 } | 78 } |
79 | 79 |
80 CERTAuthKeyID * | 80 CERTAuthKeyID * |
81 CERT_DecodeAuthKeyID (PRArenaPool *arena, const SECItem *encodedValue) | 81 CERT_DecodeAuthKeyID (PLArenaPool *arena, const SECItem *encodedValue) |
82 { | 82 { |
83 CERTAuthKeyID * value = NULL; | 83 CERTAuthKeyID * value = NULL; |
84 SECStatus rv = SECFailure; | 84 SECStatus rv = SECFailure; |
85 void * mark; | 85 void * mark; |
86 SECItem newEncodedValue; | 86 SECItem newEncodedValue; |
87 | 87 |
88 PORT_Assert (arena); | 88 PORT_Assert (arena); |
89 | 89 |
90 do { | 90 do { |
91 mark = PORT_ArenaMark (arena); | 91 mark = PORT_ArenaMark (arena); |
(...skipping 27 matching lines...) Expand all Loading... |
119 } | 119 } |
120 } while (0); | 120 } while (0); |
121 | 121 |
122 if (rv != SECSuccess) { | 122 if (rv != SECSuccess) { |
123 PORT_ArenaRelease (arena, mark); | 123 PORT_ArenaRelease (arena, mark); |
124 return ((CERTAuthKeyID *)NULL); | 124 return ((CERTAuthKeyID *)NULL); |
125 } | 125 } |
126 PORT_ArenaUnmark(arena, mark); | 126 PORT_ArenaUnmark(arena, mark); |
127 return (value); | 127 return (value); |
128 } | 128 } |
OLD | NEW |