diff options
Diffstat (limited to 'src/lib/libcrypto/ocsp/ocsp_prn.c')
-rw-r--r-- | src/lib/libcrypto/ocsp/ocsp_prn.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/lib/libcrypto/ocsp/ocsp_prn.c b/src/lib/libcrypto/ocsp/ocsp_prn.c index 3dfb51c1e4..1695c9c4ad 100644 --- a/src/lib/libcrypto/ocsp/ocsp_prn.c +++ b/src/lib/libcrypto/ocsp/ocsp_prn.c | |||
@@ -85,21 +85,21 @@ static int ocsp_certid_print(BIO *bp, OCSP_CERTID* a, int indent) | |||
85 | typedef struct | 85 | typedef struct |
86 | { | 86 | { |
87 | long t; | 87 | long t; |
88 | char *m; | 88 | const char *m; |
89 | } OCSP_TBLSTR; | 89 | } OCSP_TBLSTR; |
90 | 90 | ||
91 | static char *table2string(long s, OCSP_TBLSTR *ts, int len) | 91 | static const char *table2string(long s, const OCSP_TBLSTR *ts, int len) |
92 | { | 92 | { |
93 | OCSP_TBLSTR *p; | 93 | const OCSP_TBLSTR *p; |
94 | for (p=ts; p < ts + len; p++) | 94 | for (p=ts; p < ts + len; p++) |
95 | if (p->t == s) | 95 | if (p->t == s) |
96 | return p->m; | 96 | return p->m; |
97 | return "(UNKNOWN)"; | 97 | return "(UNKNOWN)"; |
98 | } | 98 | } |
99 | 99 | ||
100 | char *OCSP_response_status_str(long s) | 100 | const char *OCSP_response_status_str(long s) |
101 | { | 101 | { |
102 | static OCSP_TBLSTR rstat_tbl[] = { | 102 | static const OCSP_TBLSTR rstat_tbl[] = { |
103 | { OCSP_RESPONSE_STATUS_SUCCESSFUL, "successful" }, | 103 | { OCSP_RESPONSE_STATUS_SUCCESSFUL, "successful" }, |
104 | { OCSP_RESPONSE_STATUS_MALFORMEDREQUEST, "malformedrequest" }, | 104 | { OCSP_RESPONSE_STATUS_MALFORMEDREQUEST, "malformedrequest" }, |
105 | { OCSP_RESPONSE_STATUS_INTERNALERROR, "internalerror" }, | 105 | { OCSP_RESPONSE_STATUS_INTERNALERROR, "internalerror" }, |
@@ -109,18 +109,18 @@ char *OCSP_response_status_str(long s) | |||
109 | return table2string(s, rstat_tbl, 6); | 109 | return table2string(s, rstat_tbl, 6); |
110 | } | 110 | } |
111 | 111 | ||
112 | char *OCSP_cert_status_str(long s) | 112 | const char *OCSP_cert_status_str(long s) |
113 | { | 113 | { |
114 | static OCSP_TBLSTR cstat_tbl[] = { | 114 | static const OCSP_TBLSTR cstat_tbl[] = { |
115 | { V_OCSP_CERTSTATUS_GOOD, "good" }, | 115 | { V_OCSP_CERTSTATUS_GOOD, "good" }, |
116 | { V_OCSP_CERTSTATUS_REVOKED, "revoked" }, | 116 | { V_OCSP_CERTSTATUS_REVOKED, "revoked" }, |
117 | { V_OCSP_CERTSTATUS_UNKNOWN, "unknown" } }; | 117 | { V_OCSP_CERTSTATUS_UNKNOWN, "unknown" } }; |
118 | return table2string(s, cstat_tbl, 3); | 118 | return table2string(s, cstat_tbl, 3); |
119 | } | 119 | } |
120 | 120 | ||
121 | char *OCSP_crl_reason_str(long s) | 121 | const char *OCSP_crl_reason_str(long s) |
122 | { | 122 | { |
123 | OCSP_TBLSTR reason_tbl[] = { | 123 | static const OCSP_TBLSTR reason_tbl[] = { |
124 | { OCSP_REVOKED_STATUS_UNSPECIFIED, "unspecified" }, | 124 | { OCSP_REVOKED_STATUS_UNSPECIFIED, "unspecified" }, |
125 | { OCSP_REVOKED_STATUS_KEYCOMPROMISE, "keyCompromise" }, | 125 | { OCSP_REVOKED_STATUS_KEYCOMPROMISE, "keyCompromise" }, |
126 | { OCSP_REVOKED_STATUS_CACOMPROMISE, "cACompromise" }, | 126 | { OCSP_REVOKED_STATUS_CACOMPROMISE, "cACompromise" }, |
@@ -266,15 +266,16 @@ int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags) | |||
266 | if (!ASN1_GENERALIZEDTIME_print(bp,single->nextUpdate)) | 266 | if (!ASN1_GENERALIZEDTIME_print(bp,single->nextUpdate)) |
267 | goto err; | 267 | goto err; |
268 | } | 268 | } |
269 | if (!BIO_write(bp,"\n",1)) goto err; | 269 | if (BIO_write(bp,"\n",1) <= 0) goto err; |
270 | if (!X509V3_extensions_print(bp, | 270 | if (!X509V3_extensions_print(bp, |
271 | "Response Single Extensions", | 271 | "Response Single Extensions", |
272 | single->singleExtensions, flags, 8)) | 272 | single->singleExtensions, flags, 8)) |
273 | goto err; | 273 | goto err; |
274 | if (!BIO_write(bp,"\n",1)) goto err; | 274 | if (BIO_write(bp,"\n",1) <= 0) goto err; |
275 | } | 275 | } |
276 | if (!X509V3_extensions_print(bp, "Response Extensions", | 276 | if (!X509V3_extensions_print(bp, "Response Extensions", |
277 | rd->responseExtensions, flags, 4)) | 277 | rd->responseExtensions, flags, 4)) |
278 | goto err; | ||
278 | if(X509_signature_print(bp, br->signatureAlgorithm, br->signature) <= 0) | 279 | if(X509_signature_print(bp, br->signatureAlgorithm, br->signature) <= 0) |
279 | goto err; | 280 | goto err; |
280 | 281 | ||