diff options
Diffstat (limited to 'lib/libcrypto/ocsp/ocsp_cl.c')
-rw-r--r-- | lib/libcrypto/ocsp/ocsp_cl.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/lib/libcrypto/ocsp/ocsp_cl.c b/lib/libcrypto/ocsp/ocsp_cl.c index 6b8fb878804..04ea6866a54 100644 --- a/lib/libcrypto/ocsp/ocsp_cl.c +++ b/lib/libcrypto/ocsp/ocsp_cl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ocsp_cl.c,v 1.13 2016/12/30 15:31:58 jsing Exp $ */ +/* $OpenBSD: ocsp_cl.c,v 1.14 2017/01/29 17:49:23 beck Exp $ */ /* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL * project. */ @@ -159,8 +159,7 @@ OCSP_request_sign(OCSP_REQUEST *req, X509 *signer, EVP_PKEY *key, goto err; if (key) { if (!X509_check_private_key(signer, key)) { - OCSPerr(OCSP_F_OCSP_REQUEST_SIGN, - OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE); + OCSPerror(OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE); goto err; } if (!OCSP_REQUEST_sign(req, key, dgst)) @@ -202,13 +201,11 @@ OCSP_response_get1_basic(OCSP_RESPONSE *resp) rb = resp->responseBytes; if (!rb) { - OCSPerr(OCSP_F_OCSP_RESPONSE_GET1_BASIC, - OCSP_R_NO_RESPONSE_DATA); + OCSPerror(OCSP_R_NO_RESPONSE_DATA); return NULL; } if (OBJ_obj2nid(rb->responseType) != NID_id_pkix_OCSP_basic) { - OCSPerr(OCSP_F_OCSP_RESPONSE_GET1_BASIC, - OCSP_R_NOT_BASIC_RESPONSE); + OCSPerror(OCSP_R_NOT_BASIC_RESPONSE); return NULL; } @@ -341,16 +338,14 @@ OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd, /* Check thisUpdate is valid and not more than nsec in the future */ if (ASN1_time_parse(thisupd->data, thisupd->length, &tm_this, V_ASN1_GENERALIZEDTIME) != V_ASN1_GENERALIZEDTIME) { - OCSPerr(OCSP_F_OCSP_CHECK_VALIDITY, - OCSP_R_ERROR_IN_THISUPDATE_FIELD); + OCSPerror(OCSP_R_ERROR_IN_THISUPDATE_FIELD); return 0; } else { t_tmp = t_now + nsec; if (gmtime_r(&t_tmp, &tm_tmp) == NULL) return 0; if (ASN1_time_tm_cmp(&tm_this, &tm_tmp) > 0) { - OCSPerr(OCSP_F_OCSP_CHECK_VALIDITY, - OCSP_R_STATUS_NOT_YET_VALID); + OCSPerror(OCSP_R_STATUS_NOT_YET_VALID); return 0; } @@ -363,8 +358,7 @@ OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd, if (gmtime_r(&t_tmp, &tm_tmp) == NULL) return 0; if (ASN1_time_tm_cmp(&tm_this, &tm_tmp) < 0) { - OCSPerr(OCSP_F_OCSP_CHECK_VALIDITY, - OCSP_R_STATUS_TOO_OLD); + OCSPerror(OCSP_R_STATUS_TOO_OLD); return 0; } } @@ -376,24 +370,21 @@ OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd, /* Check nextUpdate is valid and not more than nsec in the past */ if (ASN1_time_parse(nextupd->data, nextupd->length, &tm_next, V_ASN1_GENERALIZEDTIME) != V_ASN1_GENERALIZEDTIME) { - OCSPerr(OCSP_F_OCSP_CHECK_VALIDITY, - OCSP_R_ERROR_IN_NEXTUPDATE_FIELD); + OCSPerror(OCSP_R_ERROR_IN_NEXTUPDATE_FIELD); return 0; } else { t_tmp = t_now - nsec; if (gmtime_r(&t_tmp, &tm_tmp) == NULL) return 0; if (ASN1_time_tm_cmp(&tm_next, &tm_tmp) < 0) { - OCSPerr(OCSP_F_OCSP_CHECK_VALIDITY, - OCSP_R_STATUS_EXPIRED); + OCSPerror(OCSP_R_STATUS_EXPIRED); return 0; } } /* Also don't allow nextUpdate to precede thisUpdate */ if (ASN1_time_tm_cmp(&tm_next, &tm_this) < 0) { - OCSPerr(OCSP_F_OCSP_CHECK_VALIDITY, - OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE); + OCSPerror(OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE); return 0; } |