diff options
author | Brian Jones <cbj@gnu.org> | 2003-02-09 18:25:41 +0000 |
---|---|---|
committer | Brian Jones <cbj@gnu.org> | 2003-02-09 18:25:41 +0000 |
commit | d4cd5c57744e823546b1997aca613b65a7bd7531 (patch) | |
tree | 83fa95d70908c0bfaebfe1c7983d67e8b38039d0 | |
parent | 6f1e049716fc413953c759c5614b0c9eb7156971 (diff) | |
download | classpath-d4cd5c57744e823546b1997aca613b65a7bd7531.tar.gz |
* doc/www.gnu.org/home.wml: add more links to projects/products using
GNU Classpath.
2003-02-09 Raif S. Naffah <raif@fl.net.au>
* gnu/java/security/provider/SHA1PRNG.java (ensureIsSeeded): new
method used to ensure seeding has occurred and that a specific
seed can be set and used.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | doc/www.gnu.org/home.wml | 34 | ||||
-rw-r--r-- | gnu/java/security/provider/SHA1PRNG.java | 32 |
3 files changed, 67 insertions, 11 deletions
@@ -1,3 +1,15 @@ +2003-02-09 C. Brian Jones <cbj@gnu.org> + + * doc/www.gnu.org/home.wml: add more links to projects/products using + GNU Classpath. + +2003-02-09 Raif S. Naffah <raif@fl.net.au> + + * gnu/java/security/provider/SHA1PRNG.java (ensureIsSeeded): new + method used to ensure seeding has occurred and that a specific + seed can be set and used. + + 2003-02-07 Stephen Crawley <crawley@dstc.edu.au> * java/beans/PropertyDescriptor.java diff --git a/doc/www.gnu.org/home.wml b/doc/www.gnu.org/home.wml index 4cb2af27c..5d4e83e48 100644 --- a/doc/www.gnu.org/home.wml +++ b/doc/www.gnu.org/home.wml @@ -251,12 +251,46 @@ into the VM's dynamic linking process through pluggable verification modules. </td> </tr> +<tr> <td><createlink url="http://www.e-leos.net/" name="E-LEOS"></td> <td> GNU Classpath is used as part of this project to create a Java operating system. </td> +</tr> +</table> + +<H4>Projects or Commercial Products</H4> +<p> +</p> + +<table border="1"> +<tr><th>Project</th><th>Description</th></tr> +<tr> +<td><createlink url="http://www.flex-compiler.lcs.mit.edu/" name="Flex Compiler"></td> +<td> +FLEX is a compiler infrastructure written in Java for Java. Applications +include a program analysis and transformation framework for distributed +and embedded systems. Native backends exist for the StrongARM and MIPS +processors; it can also generate portable C code that can run on any +platform with gcc. +</td> +</tr> <tr> +<td><createlink url="http://www.aicas.com/jamaica.html" name="JamaicaVM"></td> +<td> +JamaicaVM provides realtime execution, garbage collection, sophisticated +static optimizations and targets many real-time operating systems and +processor architectures. +</td> +</tr> +<tr> +<td><createlink url="http://www.svtehs.com/ipjv.htm" name="IPJV"></td> +<td> +The IPJVM virtual machine for Java is a clean room implementation, +that has been specially optimized to run on device with limited amount +of internal memory. IPJV-ES evaluation board is available. +</td> </tr> </table> </en> diff --git a/gnu/java/security/provider/SHA1PRNG.java b/gnu/java/security/provider/SHA1PRNG.java index 669b1b55b..97a8b9e34 100644 --- a/gnu/java/security/provider/SHA1PRNG.java +++ b/gnu/java/security/provider/SHA1PRNG.java @@ -1,5 +1,5 @@ /* SHA1PRNG.java --- Secure Random SPI SHA1PRNG - Copyright (C) 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -51,27 +51,22 @@ public class SHA1PRNG extends SecureRandomSpi implements Serializable byte data[]; int seedpos; int datapos; + private boolean seeded = false; // set to true when we seed this public SHA1PRNG() { try { digest = MessageDigest.getInstance("SHA"); } catch ( NoSuchAlgorithmException nsae) { - System.out.println("Failed to find SHA Message Digest: " + nsae); - nsae.printStackTrace(); +// System.out.println("Failed to find SHA Message Digest: " + nsae); +// nsae.printStackTrace(); + throw new InternalError ("no SHA implementation found"); } seed = new byte[20]; seedpos = 0; data = new byte[40]; - datapos = 0; - - new Random().nextBytes(seed); - - byte digestdata[]; - digestdata = digest.digest( data ); - System.arraycopy( digestdata, 0, data, 0, 20); - + datapos = 20; // try to force hashing a first block } public void engineSetSeed(byte[] seed) @@ -84,6 +79,7 @@ public class SHA1PRNG extends SecureRandomSpi implements Serializable public void engineNextBytes(byte[] bytes) { + ensureIsSeeded (); int loc = 0; while (loc < bytes.length) { @@ -113,4 +109,18 @@ public class SHA1PRNG extends SecureRandomSpi implements Serializable engineNextBytes( tmp ); return tmp; } + + private void ensureIsSeeded() + { + if (!seeded) + { + new Random(0L).nextBytes(seed); + + byte[] digestdata = digest.digest(data); + System.arraycopy(digestdata, 0, data, 0, 20); + + seeded = true; + } + } + } |