From c2ae3db1bc6dcb8ba3eb3461c05e293917c004ca Mon Sep 17 00:00:00 2001 From: mcentner Date: Thu, 30 Oct 2008 10:33:29 +0000 Subject: Updated SMCC to use exclusive access and to throw exceptions upon locked or not activated cards. Improved locale support in the security layer request and response processing. Fixed issue in STAL which prevented the use of RSA-SHA1 signatures. Added additional parameters to the applet test pages. git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@128 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../main/java/at/gv/egiz/bku/gui/PinDocument.java | 2 +- .../egiz/bku/online/webapp/BKURequestHandler.java | 20 +- BKUOnline/src/main/webapp/HTTP-ohne.html | 11 +- BKUOnline/src/main/webapp/appletPage.jsp | 29 +- .../at/gv/egiz/stal/util/JCEAlgorithmNames.java | 4 +- .../gv/egiz/bku/binding/HTTPBindingProcessor.java | 3 +- .../gv/egiz/bku/slcommands/SLCommandContext.java | 17 +- .../impl/CreateXMLSignatureCommandImpl.java | 4 +- .../egiz/bku/slcommands/impl/ErrorResultImpl.java | 42 ++- .../slcommands/impl/InfoboxReadCommandImpl.java | 2 +- .../gv/egiz/bku/slcommands/impl/SLResultImpl.java | 8 +- .../bku/slcommands/impl/ErrorResultImplTest.java | 3 +- smcc/src/main/java/at/gv/egiz/smcc/ACOSCard.java | 348 ++++++++++++--------- .../at/gv/egiz/smcc/AbstractSignatureCard.java | 169 +++++++--- .../at/gv/egiz/smcc/FileNotFoundException.java | 38 +++ .../main/java/at/gv/egiz/smcc/LockedException.java | 38 +++ .../at/gv/egiz/smcc/NotActivatedException.java | 44 +++ .../src/main/java/at/gv/egiz/smcc/STARCOSCard.java | 339 ++++++++++++-------- smcc/src/main/java/at/gv/egiz/smcc/SWCard.java | 79 ++++- .../at/gv/egiz/smcc/SignatureCardException.java | 2 +- .../java/at/gv/egiz/smcc/SignatureCardFactory.java | 223 +++++++++++-- .../java/at/gv/egiz/smcc/util/SmartCardIO.java | 3 +- .../test/java/at/gv/egiz/smcc/STARCOSCardTest.java | 92 ++++++ .../bku/smccstal/InfoBoxReadRequestHandler.java | 8 + .../gv/egiz/bku/smccstal/SignRequestHandler.java | 10 +- 25 files changed, 1149 insertions(+), 389 deletions(-) create mode 100644 smcc/src/main/java/at/gv/egiz/smcc/FileNotFoundException.java create mode 100644 smcc/src/main/java/at/gv/egiz/smcc/LockedException.java create mode 100644 smcc/src/main/java/at/gv/egiz/smcc/NotActivatedException.java create mode 100644 smcc/src/test/java/at/gv/egiz/smcc/STARCOSCardTest.java diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/PinDocument.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/PinDocument.java index 8ae9d7a3..2054ae86 100644 --- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/PinDocument.java +++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/PinDocument.java @@ -46,7 +46,7 @@ class PINDocument extends PlainDocument { @Override public void insertString(int offs, String str, AttributeSet a) throws BadLocationException { - if (pinSpec.getMaxLength() >= (getLength() + str.length())) { + if (pinSpec.getMaxLength() < 0 || pinSpec.getMaxLength() >= (getLength() + str.length())) { boolean matches = true; for (int i = 0; i < str.length(); i++) { Matcher m = pinPattern.matcher(str.substring(i, i + 1)); diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java index 6f3b9d7f..9092e3f9 100644 --- a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java +++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java @@ -44,6 +44,8 @@ import at.gv.egiz.org.apache.tomcat.util.http.AcceptLanguage; */ public class BKURequestHandler extends SpringBKUServlet { + private static final long serialVersionUID = 1L; + public final static String REDIRECT_URL = "appletPage.jsp"; protected Log log = LogFactory.getLog(BKURequestHandler.class); @@ -105,6 +107,8 @@ public class BKURequestHandler extends SpringBKUServlet { String width = getStringFromStream(bindingProcessor.getFormData("appletWidth"), charset); String height = getStringFromStream(bindingProcessor.getFormData("appletHeight"), charset); String background = getStringFromStream(bindingProcessor.getFormData("appletBackground"), charset); + String guiStyle = getStringFromStream(bindingProcessor.getFormData("appletGuiStyle"), charset); + String hashDataDisplay = getStringFromStream(bindingProcessor.getFormData("appletHashDataDisplay"), charset); if (width != null) { try { log.trace("Found applet width parameter: " + width); @@ -124,12 +128,16 @@ public class BKURequestHandler extends SpringBKUServlet { } } if (background != null) { - try { - log.trace("Found applet background parameter: " + background); - session.setAttribute("appletBackground", background); - } catch (NumberFormatException nfe) { - log.warn(nfe); - } + log.trace("Found applet background parameter: " + background); + session.setAttribute("appletBackground", background); + } + if (guiStyle != null) { + log.trace("Found applet GUI style parameter: " + guiStyle); + session.setAttribute("appletGuiStyle", guiStyle); + } + if (hashDataDisplay != null) { + log.trace("Found applet hash data display parameter: " + hashDataDisplay); + session.setAttribute("appletHashDataDisplay", hashDataDisplay); } resp.sendRedirect(REDIRECT_URL); diff --git a/BKUOnline/src/main/webapp/HTTP-ohne.html b/BKUOnline/src/main/webapp/HTTP-ohne.html index 1923113e..044432ce 100644 --- a/BKUOnline/src/main/webapp/HTTP-ohne.html +++ b/BKUOnline/src/main/webapp/HTTP-ohne.html @@ -92,8 +92,17 @@ legend { name="appletHeight" value="130" id="appletHeight">

+

+ + simple + advanced +

+

+ + external + internal +

-