misc fixes

From-SVN: r45758
This commit is contained in:
Anthony Green 2001-09-23 01:05:55 +00:00 committed by Anthony Green
parent 040cc0718f
commit 8eba5a2b7f
4 changed files with 25 additions and 6 deletions

View File

@ -1,3 +1,16 @@
2001-09-22 Anthony Green <green@redhat.com>
* java/security/DummyKeyPairGenerator.java (initialize): New
method (with AlgorithmParameterSpec argument).
2001-09-22 Anthony Green <green@redhat.com>
* 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 <rth@redhat.com>
* include/jvm.h (_Jv_VTable): Handle function descriptors for ia64;

View File

@ -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) {

View File

@ -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();

View File

@ -35,7 +35,7 @@ package java.security.spec;
@author Mark Benvenuto
*/
public abstract class EncodedKeySpec
public abstract class EncodedKeySpec implements KeySpec
{
private byte[] encodedKey;