From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5038 invoked by alias); 1 Jan 2006 23:11:29 -0000 Received: (qmail 5031 invoked by uid 22791); 1 Jan 2006 23:11:29 -0000 X-Spam-Check-By: sourceware.org Received: from smtp2.syd.swiftdsl.com.au (HELO smtp2.syd.swiftdsl.com.au) (218.214.225.98) by sourceware.org (qpsmtpd/0.31) with SMTP; Sun, 01 Jan 2006 23:11:26 +0000 Received: (qmail 5281 invoked from network); 1 Jan 2006 23:11:26 -0000 Received: from unknown (HELO ?192.168.17.2?) (218.214.50.3) by smtp2.syd.swiftdsl.com.au with SMTP; 1 Jan 2006 23:11:26 -0000 From: "Raif S. Naffah" Reply-To: raif@swiftdsl.com.au To: mauve-discuss@sourceware.org Subject: patches to ensure names w/ extra spaces are recognized Date: Sun, 01 Jan 2006 23:11:00 -0000 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2270582.16uBmomLdT"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200601021012.54773.raif@swiftdsl.com.au> Mailing-List: contact mauve-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: mauve-discuss-owner@sourceware.org X-SW-Source: 2006-q1/txt/msg00002.txt.bz2 --nextPart2270582.16uBmomLdT Content-Type: multipart/mixed; boundary="Boundary-01=_pHGuDwB8oahXemL" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_pHGuDwB8oahXemL Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Content-length: 640 hello there, pls find attached a patch to existing MessageDigest.getInstance14.java and a new Engine.getInstance file to ensure that Provider, Service and Algorithm names should be recognized even when they contain extra space characters. the corresponding ChangeLog entry follows: 2006-01-02 Raif S. Naffah * gnu/testlet/java/security/MessageDigest/getInstance14.java (test): Corrected string literal used in harness.checkPoint(). Added 2 new testcases to test passing Provider and Algorithm names with extra spaces. * gnu/testlet/java/security/Engine/getInstance.java: new file. --=20 cheers; rsn --Boundary-01=_pHGuDwB8oahXemL Content-Type: text/x-diff; charset="us-ascii"; name="mauve-20060102.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="mauve-20060102.patch" Content-length: 5054 Index: getInstance14.java =================================================================== RCS file: /cvs/mauve/mauve/gnu/testlet/java/security/MessageDigest/getInstance14.java,v retrieving revision 1.2 diff -u -r1.2 getInstance14.java --- getInstance14.java 7 Apr 2003 15:42:11 -0000 1.2 +++ getInstance14.java 1 Jan 2006 22:50:50 -0000 @@ -25,6 +25,8 @@ package gnu.testlet.java.security.MessageDigest; import gnu.testlet.Testlet; import gnu.testlet.TestHarness; + +import java.security.GeneralSecurityException; import java.security.MessageDigest; import java.security.Provider; import java.security.NoSuchAlgorithmException; @@ -43,7 +45,7 @@ public void test (TestHarness harness) { - harness.checkPoint ("KeyPairGenerator"); + harness.checkPoint ("MessageDigest"); MessageDigest spi; Provider provider = this; @@ -51,6 +53,19 @@ String signature; spi = null; + signature = "getInstance(\"foo\", \" MessageDigest \")"; + try + { + spi = MessageDigest.getInstance("foo", " MessageDigest "); + harness.check(spi != null, signature); + } + catch (GeneralSecurityException x) + { + harness.fail(signature); + harness.debug(x); + } + + spi = null; signature = "getInstance(\"foo\", provider)"; try { @@ -64,6 +79,19 @@ } spi = null; + signature = "getInstance(\" foo \", provider)"; + try + { + spi = MessageDigest.getInstance(" foo ", provider); + harness.check(spi != null, signature); + } + catch (NoSuchAlgorithmException x) + { + harness.fail(signature); + harness.debug(x); + } + + spi = null; signature = "getInstance(\"FOO\", provider)"; try { Index: gnu/testlet/java/security/Engine/getInstance.java =================================================================== RCS file: gnu/testlet/java/security/Engine/getInstance.java diff -N gnu/testlet/java/security/Engine/getInstance.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gnu/testlet/java/security/Engine/getInstance.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,106 @@ +/* getInstance.java -- Ensure names with extra spaces are recognized + Copyright (C) 2006 Free Software Foundation, Inc. +This file is part of Mauve. + +Mauve is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +Mauve is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Mauve; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +*/ + +// Tags: JDK1.4 +// Uses: MauveDigest + +package gnu.testlet.java.security.Engine; + +import gnu.java.security.Engine; +import gnu.testlet.TestHarness; +import gnu.testlet.Testlet; + +import java.security.Provider; +import java.security.Security; + +public class getInstance extends Provider implements Testlet +{ + public getInstance() + { + super("FakeProvider", 1.0, ""); + + put("MessageDigest.foo", + "gnu.testlet.java.security.MessageDigest.MauveDigest"); + put("Alg.Alias.MessageDigest.bar", "foo"); + } + + public void test (TestHarness harness) + { + harness.checkPoint ("Engine"); + + Provider provider = this; + Security.addProvider(provider); + String signature; + + signature = "getInstance(\"MessageDigest\", \"foo\", provider)"; + try + { + harness.check( + Engine.getInstance("MessageDigest", "foo", provider) != null, + signature); + } + catch (Exception x) + { + harness.fail(signature); + harness.debug(x); + } + + signature = "getInstance(\" MessageDigest \", \"foo\", provider)"; + try + { + harness.check( + Engine.getInstance(" MessageDigest ", "foo", provider) != null, + signature); + } + catch (Exception x) + { + harness.fail(signature); + harness.debug(x); + } + + signature = "getInstance(\"MessageDigest\", \" foo \", provider)"; + try + { + harness.check( + Engine.getInstance("MessageDigest", " foo ", provider) != null, + signature); + } + catch (Exception x) + { + harness.fail(signature); + harness.debug(x); + } + + signature = "getInstance(\" MessageDigest \", \" foo \", provider)"; + try + { + harness.check( + Engine.getInstance(" MessageDigest ", " foo ", provider) != null, + signature); + } + catch (Exception x) + { + harness.fail(signature); + harness.debug(x); + } + } +} + --Boundary-01=_pHGuDwB8oahXemL-- --nextPart2270582.16uBmomLdT Content-Type: application/pgp-signature Content-length: 216 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Que du magnifique iD8DBQBDuGH2+e1AKnsTRiERA5jUAJ9jMv26KgKNgHlrXoPJbY0Fd7J3TQCeNpXr O3JInrdxR11h9OLcJEMDHpI= =5LNE -----END PGP SIGNATURE----- --nextPart2270582.16uBmomLdT--