diff options
author | Endi S. Dewata <edewata@redhat.com> | 2017-06-20 08:18:20 +0200 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2017-06-20 20:05:11 +0200 |
commit | 4aa28a72c7deea46f8c7bc407153fd50030bb311 (patch) | |
tree | e52d5009668ea03895723b3aeb806a9f9b69ff51 /base/ca/src/com | |
parent | 53d695a365b8a104b507970381a6a88df8624cd9 (diff) | |
download | pki-4aa28a72c7deea46f8c7bc407153fd50030bb311.tar.gz pki-4aa28a72c7deea46f8c7bc407153fd50030bb311.tar.xz pki-4aa28a72c7deea46f8c7bc407153fd50030bb311.zip |
Fixed OCSP service error handling.
Some OCSP-related classes have been modified to detect errors and
handle exceptions properly.
https://pagure.io/dogtagpki/issue/2652
Change-Id: Ifd054c47d04ff106120df2d7f3705366c7de9da9
Diffstat (limited to 'base/ca/src/com')
-rw-r--r-- | base/ca/src/com/netscape/ca/CertificateAuthority.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/base/ca/src/com/netscape/ca/CertificateAuthority.java b/base/ca/src/com/netscape/ca/CertificateAuthority.java index d4b8d7ecd..31a0c03b6 100644 --- a/base/ca/src/com/netscape/ca/CertificateAuthority.java +++ b/base/ca/src/com/netscape/ca/CertificateAuthority.java @@ -2312,6 +2312,11 @@ public class CertificateAuthority } TBSRequest tbsReq = request.getTBSRequest(); + if (tbsReq.getRequestCount() == 0) { + CMS.debug("CertificateAuthority: No request found"); + log(ILogger.LL_FAILURE, CMS.getLogMessage("OCSP_REQUEST_FAILURE", "No Request Found")); + throw new EBaseException("OCSP request is empty"); + } /* An OCSP request can contain CertIDs for certificates * issued by different CAs, but each SingleResponse is valid @@ -2451,10 +2456,10 @@ public class CertificateAuthority mTotalTime += endTime - startTime; return response; - } catch (Exception e) { + } catch (EBaseException e) { log(ILogger.LL_FAILURE, CMS.getLogMessage("CMSCORE_CA_CA_OCSP_REQUEST", e.toString())); - throw new EBaseException(e.toString(), e); + throw e; } } |