OLD | NEW |
1 /* v3_enum.c */ | 1 /* v3_enum.c */ |
2 /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 * project 1999. | 3 * project 1999. |
4 */ | 4 */ |
5 /* ==================================================================== | 5 /* ==================================================================== |
6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved. | 6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved. |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 * (eay@cryptsoft.com). This product includes software written by Tim | 54 * (eay@cryptsoft.com). This product includes software written by Tim |
55 * Hudson (tjh@cryptsoft.com). | 55 * Hudson (tjh@cryptsoft.com). |
56 * | 56 * |
57 */ | 57 */ |
58 | 58 |
59 #include <stdio.h> | 59 #include <stdio.h> |
60 #include "cryptlib.h" | 60 #include "cryptlib.h" |
61 #include <openssl/x509v3.h> | 61 #include <openssl/x509v3.h> |
62 | 62 |
63 static ENUMERATED_NAMES crl_reasons[] = { | 63 static ENUMERATED_NAMES crl_reasons[] = { |
64 {0, "Unspecified", "unspecified"}, | 64 {CRL_REASON_UNSPECIFIED, » "Unspecified", "unspecified"}, |
65 {1, "Key Compromise", "keyCompromise"}, | 65 {CRL_REASON_KEY_COMPROMISE,» "Key Compromise", "keyCompromise"}, |
66 {2, "CA Compromise", "CACompromise"}, | 66 {CRL_REASON_CA_COMPROMISE,» "CA Compromise", "CACompromise"}, |
67 {3, "Affiliation Changed", "affiliationChanged"}, | 67 {CRL_REASON_AFFILIATION_CHANGED, "Affiliation Changed", "affiliationChanged"}, |
68 {4, "Superseded", "superseded"}, | 68 {CRL_REASON_SUPERSEDED, » "Superseded", "superseded"}, |
69 {5, "Cessation Of Operation", "cessationOfOperation"}, | 69 {CRL_REASON_CESSATION_OF_OPERATION, |
70 {6, "Certificate Hold", "certificateHold"}, | 70 » » » "Cessation Of Operation", "cessationOfOperation"}, |
71 {8, "Remove From CRL", "removeFromCRL"}, | 71 {CRL_REASON_CERTIFICATE_HOLD,» "Certificate Hold", "certificateHold"}, |
| 72 {CRL_REASON_REMOVE_FROM_CRL,» "Remove From CRL", "removeFromCRL"}, |
| 73 {CRL_REASON_PRIVILEGE_WITHDRAWN, "Privilege Withdrawn", "privilegeWithdrawn"}, |
| 74 {CRL_REASON_AA_COMPROMISE,» "AA Compromise", "AACompromise"}, |
72 {-1, NULL, NULL} | 75 {-1, NULL, NULL} |
73 }; | 76 }; |
74 | 77 |
75 const X509V3_EXT_METHOD v3_crl_reason = { | 78 const X509V3_EXT_METHOD v3_crl_reason = { |
76 NID_crl_reason, 0, ASN1_ITEM_ref(ASN1_ENUMERATED), | 79 NID_crl_reason, 0, ASN1_ITEM_ref(ASN1_ENUMERATED), |
77 0,0,0,0, | 80 0,0,0,0, |
78 (X509V3_EXT_I2S)i2s_ASN1_ENUMERATED_TABLE, | 81 (X509V3_EXT_I2S)i2s_ASN1_ENUMERATED_TABLE, |
79 0, | 82 0, |
80 0,0,0,0, | 83 0,0,0,0, |
81 crl_reasons}; | 84 crl_reasons}; |
82 | 85 |
83 | 86 |
84 char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, | 87 char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, |
85 ASN1_ENUMERATED *e) | 88 ASN1_ENUMERATED *e) |
86 { | 89 { |
87 ENUMERATED_NAMES *enam; | 90 ENUMERATED_NAMES *enam; |
88 long strval; | 91 long strval; |
89 strval = ASN1_ENUMERATED_get(e); | 92 strval = ASN1_ENUMERATED_get(e); |
90 for(enam = method->usr_data; enam->lname; enam++) { | 93 for(enam = method->usr_data; enam->lname; enam++) { |
91 if(strval == enam->bitnum) return BUF_strdup(enam->lname); | 94 if(strval == enam->bitnum) return BUF_strdup(enam->lname); |
92 } | 95 } |
93 return i2s_ASN1_ENUMERATED(method, e); | 96 return i2s_ASN1_ENUMERATED(method, e); |
94 } | 97 } |
OLD | NEW |