From 02b2927cfbdb4a13ef7e75ef1fdd210ce0af4847 Mon Sep 17 00:00:00 2001 From: green Date: Sun, 23 Sep 2001 01:05:55 +0000 Subject: [PATCH] misc fixes git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45758 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/ChangeLog | 13 +++++++++++++ libjava/gnu/java/security/provider/SHA1PRNG.java | 9 ++++----- libjava/java/security/DummyKeyPairGenerator.java | 7 +++++++ libjava/java/security/spec/EncodedKeySpec.java | 2 +- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index fe52c14..506b21a 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,16 @@ +2001-09-22 Anthony Green + + * java/security/DummyKeyPairGenerator.java (initialize): New + method (with AlgorithmParameterSpec argument). + +2001-09-22 Anthony Green + + * java/security/spec/EncodedKeySpec.java: Implements KeySpec. + + * gnu/java/security/provider/SHA1PRNG.java: Extend from + SecureRandomSpi. + (engineNextBytes): Fix order of memory copies. + 2001-09-21 Richard Henderson * include/jvm.h (_Jv_VTable): Handle function descriptors for ia64; diff --git a/libjava/gnu/java/security/provider/SHA1PRNG.java b/libjava/gnu/java/security/provider/SHA1PRNG.java index 3aaf652..bb34ef0 100644 --- a/libjava/gnu/java/security/provider/SHA1PRNG.java +++ b/libjava/gnu/java/security/provider/SHA1PRNG.java @@ -28,13 +28,12 @@ executable file might be covered by the GNU General Public License. */ package gnu.java.security.provider; import java.util.Random; -// import java.security.SecureRandomSpi; +import java.security.SecureRandomSpi; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.io.Serializable; -// public class SHA1PRNG extends SecureRandomSpi implements Serializable -public class SHA1PRNG implements Serializable +public class SHA1PRNG extends SecureRandomSpi implements Serializable { MessageDigest digest; byte seed[]; @@ -76,7 +75,7 @@ public class SHA1PRNG implements Serializable { if( bytes.length < (20 - datapos) ) { - System.arraycopy( bytes, 0, data, datapos, bytes.length); + System.arraycopy( data, datapos, bytes, 0, bytes.length); datapos += bytes.length; return; } @@ -85,7 +84,7 @@ public class SHA1PRNG implements Serializable byte digestdata[]; while( bpos < blen ) { i = 20 - datapos; - System.arraycopy( bytes, bpos, data, datapos, i); + System.arraycopy( data, datapos, bytes, bpos, i); bpos += i; datapos += i; if( datapos >= 20) { diff --git a/libjava/java/security/DummyKeyPairGenerator.java b/libjava/java/security/DummyKeyPairGenerator.java index 6b3f146..3260576 100644 --- a/libjava/java/security/DummyKeyPairGenerator.java +++ b/libjava/java/security/DummyKeyPairGenerator.java @@ -25,6 +25,7 @@ This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ package java.security; +import java.security.spec.AlgorithmParameterSpec; final class DummyKeyPairGenerator extends KeyPairGenerator { @@ -41,6 +42,12 @@ final class DummyKeyPairGenerator extends KeyPairGenerator kpgSpi.initialize(keysize, random); } + public void initialize(AlgorithmParameterSpec params, SecureRandom random) + throws InvalidAlgorithmParameterException + { + kpgSpi.initialize(params, random); + } + public KeyPair generateKeyPair() { return kpgSpi.generateKeyPair(); diff --git a/libjava/java/security/spec/EncodedKeySpec.java b/libjava/java/security/spec/EncodedKeySpec.java index d0a83f8..2d6bd12 100644 --- a/libjava/java/security/spec/EncodedKeySpec.java +++ b/libjava/java/security/spec/EncodedKeySpec.java @@ -35,7 +35,7 @@ package java.security.spec; @author Mark Benvenuto */ -public abstract class EncodedKeySpec +public abstract class EncodedKeySpec implements KeySpec { private byte[] encodedKey; -- 2.7.4