Hi Raif,

On Fri, 2006-02-24 at 00:23 +1100, Raif S. Naffah wrote:
> this pacth --already committed-- adds more JCE classes as described 
> above.  it also refactors some code into a new utility class, and 
> finally fixes some bugs which were discovered while implementing and 
> using some new Mauve tests (see below).
>
> 2006-02-23  Raif S. Naffah  <[EMAIL PROTECTED]>
> 
>       * gnu/javax/crypto/key/dh/GnuDHKeyPairGenerator.java
>       (DEFAULT_PRIME_SIZE): Made public.
>       (DEFAULT_EXPONENT_SIZE): Likewise.
>       (setup): Handle DHParameterSpec as well.
>       * gnu/javax/crypto/key/dh/GnuDHKey.java (getEncoded): Return
>       defaultFormat instead of Raw.
>       * gnu/javax/crypto/key/dh/DHKeyPairX509Codec.java
>       (checkIsConstructed): Removed.
>       (checkIsBigInteger): Likewise.
>       (decodePublicKey): Use DerUtil.
>       * gnu/javax/crypto/key/dh/DHKeyPairPKCS8Codec.java
>       (checkIsConstructed): Removed.
>       (checkIsBigInteger): Likewise.
>       (decodePrivateKey): Use DerUtil.
>       * gnu/javax/crypto/jce/GnuCrypto.java (run): Updated mapping of
>       KeyAgreement.DH.
>       Added mappings for AlgorithmParameters.DH and
>       AlgorithmParameterGenerator.DH.
>       * gnu/javax/crypto/jce/DiffieHellmanImpl.java: New file.
>       * gnu/javax/crypto/jce/sig/DHParametersGenerator.java: Likewise.
>       * gnu/javax/crypto/jce/sig/DHParameters.java: Likewise.
>       * gnu/javax/crypto/jce/sig/DHKeyFactory.java (engineGeneratePrivate):
>       Return result.
>       (engineGeneratePublic): Likewise.
>       * gnu/java/security/util/DerUtil.java: New file.
>       * gnu/java/security/sig/rsa/RSASignatureFactory.java (getNames):
>       Include only valid RSA PKCS1 (v1.5) signature names.
>       * gnu/java/security/sig/rsa/RSAPKCS1V1_5SignatureX509Codec.java
>       (RSAPKCS1V1_5SignatureX509Codec): Removed.
>       (checkIsConstructed): Likewise.
>       * gnu/java/security/sig/dss/DSSSignatureX509Codec.java
>       (checkIsConstructed): Removed.
>       (checkIsBigInteger): Likewise.
>       (decodeSignature): Use DerUtil.
>       * gnu/java/security/key/rsa/RSAKeyPairX509Codec.java
>       (checkIsConstructed): Removed.
>       (checkIsBigInteger): Likewise.
>       (decodePublicKey): Use DerUtil.
>       * gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java
>       (checkIsConstructed): Removed.
>       (checkIsBigInteger): Likewise.
>       (decodePrivateKey): Use DerUtil.
>       * gnu/java/security/key/dss/DSSKeyPairX509Codec.java
>       (checkIsConstructed): Removed.
>       (checkIsBigInteger): Likewise.
>       (decodePublicKey): Use DerUtil.
>       * gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.java
>       (checkIsConstructed): Removed.
>       (checkIsBigInteger): Likewise.
>       (decodePrivateKey): Use DerUtil.
>       * gnu/java/security/key/dss/DSSKeyPairGenerator.java
>       (DEFAULT_MODULUS_LENGTH): Made it public.
>       * gnu/java/security/key/dss/DSSKey.java (getEncoded): Return
>       defaultFormat instead of Raw.
>       * gnu/java/security/jce/sig/DSSParametersGenerator.java: New file.
>       * gnu/java/security/jce/sig/DSSParameters.java: Likewise..
>       * gnu/java/security/jce/sig/DSSKeyFactory.java (engineGeneratePrivate):
>       Return result.
>       (engineGeneratePublic): Likewise.
>       * gnu/javax/crypto/DiffieHellmanImpl: Removed.

It looks like this patch broke https support for me.
The following little program gives an error now:

import java.io.*;
import java.net.*;

public class HTTPS
{
  public static void main(String[] args) throws Exception
  {
    URL u = new URL("https://www.paypal.com/";);
    InputStream in = u.openStream();
    BufferedReader br = new BufferedReader(new InputStreamReader(in));
    String line = br.readLine();
    while (line != null)
      {
        System.out.println(line);
        line = br.readLine();
      }
  }
}

javax.net.ssl.SSLPeerUnverifiedException: could not verify peer certificate: 
C=US,ST=California,L=Mountain View,O=Paypal Inc.,OU=Information 
Systems,OU=Terms of use at www.verisign.com/rpa (c)00,CN=www.paypal.com
   at gnu.javax.net.ssl.provider.SSLSocket.doClientHandshake 
(SSLSocket.java:1559)
[...]
Caused by: java.security.InvalidParameterException: Wrong signature field
   at gnu.java.security.sig.rsa.RSAPKCS1V1_5SignatureX509Codec.decodeSignature 
(RSAPKCS1V1_5SignatureX509Codec.java:144)
   at gnu.java.security.jce.sig.SignatureAdapter.engineVerify 
(SignatureAdapter.java:226)
[...]

Apparently because RSAPKCS1V1_5SignatureX509Codec expects
DERValue.getValue() to return a BitString.

Cheers,

Mark

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to