From 2f19e8e81a42b495108b31133e37917ffd0620a8 Mon Sep 17 00:00:00 2001
From: tkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>
Date: Tue, 13 Aug 2013 09:38:01 +0000
Subject: RipeMD-160 fix for AppletSecureViewer

git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1190 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
 .../at/gv/egiz/bku/online/applet/AppletSecureViewer.java    | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

(limited to 'BKUApplet/src/main/java/at')

diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java
index 6385860b..ca93aa50 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java
@@ -36,7 +36,9 @@ import at.gv.egiz.stal.signedinfo.ReferenceType;
 import at.gv.egiz.stal.signedinfo.SignedInfoType;
 import java.awt.event.ActionListener;
 import java.security.DigestException;
-import java.security.MessageDigest;
+
+import iaik.me.security.CryptoException;
+import iaik.me.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -227,12 +229,17 @@ public class AppletSecureViewer implements SecureViewer {
     } else if ("http://www.w3.org/2001/04/xmldsig-more#md5".equals(mdAlg)) {
       mdAlg = "MD5";
     } else if ("http://www.w3.org/2001/04/xmlenc#ripemd160".equals(mdAlg)) {
-      mdAlg = "RipeMD-160";
+      mdAlg = "RIPEMD160";
     } else {
       throw new NoSuchAlgorithmException("Failed to verify digest value: unsupported digest algorithm " + mdAlg);
     }
 
-    MessageDigest md = MessageDigest.getInstance(mdAlg);
+    MessageDigest md;
+    try {
+      md = MessageDigest.getInstance(mdAlg);
+    } catch (CryptoException e) {
+      throw new NoSuchAlgorithmException(e);
+    }
     return md.digest(hashDataInput);
   }
 }
-- 
cgit v1.2.3