OLD | NEW |
1 /* v3_pci.c -*- mode:C; c-file-style: "eay" -*- */ | 1 /* v3_pci.c -*- mode:C; c-file-style: "eay" -*- */ |
2 /* Contributed to the OpenSSL Project 2004 | 2 /* Contributed to the OpenSSL Project 2004 |
3 * by Richard Levitte (richard@levitte.org) | 3 * by Richard Levitte (richard@levitte.org) |
4 */ | 4 */ |
5 /* Copyright (c) 2004 Kungliga Tekniska Högskolan | 5 /* Copyright (c) 2004 Kungliga Tekniska Högskolan |
6 * (Royal Institute of Technology, Stockholm, Sweden). | 6 * (Royal Institute of Technology, Stockholm, Sweden). |
7 * All rights reserved. | 7 * All rights reserved. |
8 * | 8 * |
9 * Redistribution and use in source and binary forms, with or without | 9 * Redistribution and use in source and binary forms, with or without |
10 * modification, are permitted provided that the following conditions | 10 * modification, are permitted provided that the following conditions |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 static int process_pci_value(CONF_VALUE *val, | 75 static int process_pci_value(CONF_VALUE *val, |
76 ASN1_OBJECT **language, ASN1_INTEGER **pathlen, | 76 ASN1_OBJECT **language, ASN1_INTEGER **pathlen, |
77 ASN1_OCTET_STRING **policy) | 77 ASN1_OCTET_STRING **policy) |
78 { | 78 { |
79 int free_policy = 0; | 79 int free_policy = 0; |
80 | 80 |
81 if (strcmp(val->name, "language") == 0) | 81 if (strcmp(val->name, "language") == 0) |
82 { | 82 { |
83 if (*language) | 83 if (*language) |
84 { | 84 { |
85 » » » X509V3err(X509V3_F_PROCESS_PCI_VALUE,X509V3_R_POLICY_LAN
GUAGE_ALREADTY_DEFINED); | 85 » » » X509V3err(X509V3_F_PROCESS_PCI_VALUE,X509V3_R_POLICY_LAN
GUAGE_ALREADY_DEFINED); |
86 X509V3_conf_err(val); | 86 X509V3_conf_err(val); |
87 return 0; | 87 return 0; |
88 } | 88 } |
89 if (!(*language = OBJ_txt2obj(val->value, 0))) | 89 if (!(*language = OBJ_txt2obj(val->value, 0))) |
90 { | 90 { |
91 X509V3err(X509V3_F_PROCESS_PCI_VALUE,X509V3_R_INVALID_OB
JECT_IDENTIFIER); | 91 X509V3err(X509V3_F_PROCESS_PCI_VALUE,X509V3_R_INVALID_OB
JECT_IDENTIFIER); |
92 X509V3_conf_err(val); | 92 X509V3_conf_err(val); |
93 return 0; | 93 return 0; |
94 } | 94 } |
95 } | 95 } |
96 else if (strcmp(val->name, "pathlen") == 0) | 96 else if (strcmp(val->name, "pathlen") == 0) |
97 { | 97 { |
98 if (*pathlen) | 98 if (*pathlen) |
99 { | 99 { |
100 » » » X509V3err(X509V3_F_PROCESS_PCI_VALUE,X509V3_R_POLICY_PAT
H_LENGTH_ALREADTY_DEFINED); | 100 » » » X509V3err(X509V3_F_PROCESS_PCI_VALUE,X509V3_R_POLICY_PAT
H_LENGTH_ALREADY_DEFINED); |
101 X509V3_conf_err(val); | 101 X509V3_conf_err(val); |
102 return 0; | 102 return 0; |
103 } | 103 } |
104 if (!X509V3_get_value_int(val, pathlen)) | 104 if (!X509V3_get_value_int(val, pathlen)) |
105 { | 105 { |
106 X509V3err(X509V3_F_PROCESS_PCI_VALUE,X509V3_R_POLICY_PAT
H_LENGTH); | 106 X509V3err(X509V3_F_PROCESS_PCI_VALUE,X509V3_R_POLICY_PAT
H_LENGTH); |
107 X509V3_conf_err(val); | 107 X509V3_conf_err(val); |
108 return 0; | 108 return 0; |
109 } | 109 } |
110 } | 110 } |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 goto end; | 319 goto end; |
320 err: | 320 err: |
321 if (language) { ASN1_OBJECT_free(language); language = NULL; } | 321 if (language) { ASN1_OBJECT_free(language); language = NULL; } |
322 if (pathlen) { ASN1_INTEGER_free(pathlen); pathlen = NULL; } | 322 if (pathlen) { ASN1_INTEGER_free(pathlen); pathlen = NULL; } |
323 if (policy) { ASN1_OCTET_STRING_free(policy); policy = NULL; } | 323 if (policy) { ASN1_OCTET_STRING_free(policy); policy = NULL; } |
324 if (pci) { PROXY_CERT_INFO_EXTENSION_free(pci); pci = NULL; } | 324 if (pci) { PROXY_CERT_INFO_EXTENSION_free(pci); pci = NULL; } |
325 end: | 325 end: |
326 sk_CONF_VALUE_pop_free(vals, X509V3_conf_free); | 326 sk_CONF_VALUE_pop_free(vals, X509V3_conf_free); |
327 return pci; | 327 return pci; |
328 } | 328 } |
OLD | NEW |