pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1847971 - /pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/OcspHelper.java
Date Sun, 02 Dec 2018 11:13:03 GMT
Author: tilman
Date: Sun Dec  2 11:13:03 2018
New Revision: 1847971

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

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

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/OcspHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/OcspHelper.java?rev=1847971&r1=1847970&r2=1847971&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/OcspHelper.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/OcspHelper.java
Sun Dec  2 11:13:03 2018
@@ -250,7 +250,8 @@ public class OcspHelper
         catch (NoSuchAlgorithmException ex)
         {
             // should not happen
-            return null;
+            LOG.error("SHA-1 Algorithm not found", ex);
+            return new byte[0];
         }
     }
 
@@ -591,10 +592,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