pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1847970 - /pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/OcspHelper.java
Date Sun, 02 Dec 2018 11:12:59 GMT
Author: tilman
Date: Sun Dec  2 11:12:59 2018
New Revision: 1847970

URL: http://svn.apache.org/viewvc?rev=1847970&view=rev
Log:
PDFBOX-3017: SonarQube fix

Modified:
    pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/OcspHelper.java

Modified: pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/OcspHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/OcspHelper.java?rev=1847970&r1=1847969&r2=1847970&view=diff
==============================================================================
--- pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/OcspHelper.java
(original)
+++ pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/OcspHelper.java
Sun Dec  2 11:12:59 2018
@@ -251,7 +251,8 @@ public class OcspHelper
         catch (NoSuchAlgorithmException ex)
         {
             // should not happen
-            return null;
+            LOG.error("SHA-1 Algorithm not found", ex);
+            return new byte[0];
         }
     }
 
@@ -602,10 +603,11 @@ public class OcspHelper
                 MessageDigest md = MessageDigest.getInstance("SHA-1");
                 return md.digest(bytes);
             }
-            catch (NoSuchAlgorithmException e)
+            catch (NoSuchAlgorithmException ex)
             {
-                LOG.error("SHA-1 Algorithm not found", e);
-                return null;
+                // should not happen
+                LOG.error("SHA-1 Algorithm not found", ex);
+                return new byte[0];
             }
         }
     }



Mime
View raw message