You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Sergey Dmitriev <se...@gmail.com> on 2007/05/03 14:34:02 UTC

Diffie-Hellman KeyPairGenerator problem

Guys

could some of you take a look at java.security.KeyPairGenerator?
It hangs while generating public/private key pair.

I filed JIRA with respect to this:
https://issues.apache.org/jira/browse/HARMONY-3789.


Thanks
Sergey

Re: Diffie-Hellman KeyPairGenerator problem

Posted by Sergey Dmitriev <se...@gmail.com>.
I just have checked: it is reproducible on gcc-release build r534465,
BouncyCastle is 1.36 (actually this is the last downloadable version)
and this version is used in Harmony currently.

] boy@moon ~
] time ~/jre2/bin/java -showversion -cp ~ keyagreement
Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software
Foundation or its licensors, as applicable.
java version "1.5.0"
pre-alpha : not complete or compatible
svn = r534465, (May  2 2007), Linux/ia32/gcc 3.3.3, release build
http://incubator.apache.org/harmony
ka: javax.crypto.KeyAgreement@427c93b0
kpg=org.bouncycastle.jce.provider.JDKKeyPairGenerator$DH@427d1274(class
org.bouncycastle.jce.provider.JDKKeyPairGenerator$DH)
^C

real    1m8.886s
user    1m8.752s
sys     0m0.088s


Thanks
Sergey


On 5/3/07, Mikhail Loenko <ml...@gmail.com> wrote:
> is it reproducible with newer version of boncycastle (r534363 or newer)?
>
> Thanks,
> Mikhail
>
> 2007/5/3, Sergey Dmitriev <se...@gmail.com>:
> > Guys
> >
> > could some of you take a look at java.security.KeyPairGenerator?
> > It hangs while generating public/private key pair.
> >
> > I filed JIRA with respect to this:
> > https://issues.apache.org/jira/browse/HARMONY-3789.
> >
> >
> > Thanks
> > Sergey

Re: Diffie-Hellman KeyPairGenerator problem

Posted by Mikhail Loenko <ml...@gmail.com>.
is it reproducible with newer version of boncycastle (r534363 or newer)?

Thanks,
Mikhail

2007/5/3, Sergey Dmitriev <se...@gmail.com>:
> Guys
>
> could some of you take a look at java.security.KeyPairGenerator?
> It hangs while generating public/private key pair.
>
> I filed JIRA with respect to this:
> https://issues.apache.org/jira/browse/HARMONY-3789.
>
>
> Thanks
> Sergey
>

Re: Diffie-Hellman KeyPairGenerator problem

Posted by Sergey Dmitriev <se...@gmail.com>.
> Interesting ... to browse Bouncy Casle JIRA an account is required.

Yep, pretty interesting. Anyway I've added justification from BJA-19
to HARMONY-3789.

> Anyway could you add a link(to BJA-19) to HARMONY-3789 and close it?

I just have done it. Thanks everybody.


Sergey


On 5/7/07, Stepan Mishura <st...@gmail.com> wrote:
> On 5/6/07, Sergey Dmitriev wrote:
> > Actually I've filed an issue on Bouncy Casle JIRA,
> > http://www.bouncycastle.org/jira/browse/BJA-19. It is closed as not a
> > bug.
> >
>
> Interesting ... to browse Bouncy Casle JIRA an account is required.
>
> Anyway could you add a link(to BJA-19) to HARMONY-3789 and close it?
>
> Thanks,
> Stepan.
>
> > Thanks, Sergey
> >
> >
> > On 5/5/07, Sergey Dmitriev <se...@gmail.com> wrote:
> > > Yes, the case you mentioned hangs on my side as well.
> > >
> > > Well I've replaced Harmony's math.jar with JRockit's math classes -
> > > the same picture, it just hangs. It is not about math.  I've taken a
> > > walk to BC sources and found that it does not actually hangs up - it
> > > just works very long. The problem is in safe primes generation for DH
> > > in org.bouncycastle.crypto.generators.DHParametersHelper.generateSafePrimes().
> > >
> > > The default values I found there are: strength = 1024 bit, certainty = 20.
> > >
> > > Probably some crypto specialists can comment this issue out.
> > >
> > > BTW the given testcase comes "back to life" in 12-15 minutes on
> > > my box.
> > >
> > >
> > > Thank
> > > Sergey
> > >
> > >
> > > On 5/4/07, Stepan Mishura <st...@gmail.com> wrote:
> > > > On 5/3/07, Sergey Dmitriev <se...@gmail.com> wrote:
> > > > > Guys
> > > > >
> > > > > could some of you take a look at java.security.KeyPairGenerator?
> > > > > It hangs while generating public/private key pair.
> > > > >
> > > >
> > > > The test hands for me on BEA JRockit. I did the following:
> > > > 1) modify a test from JIRA - add provider name param to method:
> > > > KeyPairGenerator.getInstance("DH", "BC");
> > > > 2) copy <classlib>/depends/jars/bcprov-jdk15-136/bcprov.jar to
> > > > jre/lib/ext directory
> > > > 3) add line to java.security file:
> > > > security.provider.7=org.bouncycastle.jce.provider.BouncyCastleProvider
> > > >
> > > > Could you reproduce it?
> > > >
> > > > -Stepan.
> > > >
> > > > > I filed JIRA with respect to this:
> > > > > https://issues.apache.org/jira/browse/HARMONY-3789.
> > > > >
> > > > >
> > > > > Thanks
> > > > > Sergey
>
>
> --
> Stepan Mishura
> Intel Enterprise Solutions Software Division
>

Re: Diffie-Hellman KeyPairGenerator problem

Posted by Stepan Mishura <st...@gmail.com>.
On 5/6/07, Sergey Dmitriev wrote:
> Actually I've filed an issue on Bouncy Casle JIRA,
> http://www.bouncycastle.org/jira/browse/BJA-19. It is closed as not a
> bug.
>

Interesting ... to browse Bouncy Casle JIRA an account is required.

Anyway could you add a link(to BJA-19) to HARMONY-3789 and close it?

Thanks,
Stepan.

> Thanks, Sergey
>
>
> On 5/5/07, Sergey Dmitriev <se...@gmail.com> wrote:
> > Yes, the case you mentioned hangs on my side as well.
> >
> > Well I've replaced Harmony's math.jar with JRockit's math classes -
> > the same picture, it just hangs. It is not about math.  I've taken a
> > walk to BC sources and found that it does not actually hangs up - it
> > just works very long. The problem is in safe primes generation for DH
> > in org.bouncycastle.crypto.generators.DHParametersHelper.generateSafePrimes().
> >
> > The default values I found there are: strength = 1024 bit, certainty = 20.
> >
> > Probably some crypto specialists can comment this issue out.
> >
> > BTW the given testcase comes "back to life" in 12-15 minutes on
> > my box.
> >
> >
> > Thank
> > Sergey
> >
> >
> > On 5/4/07, Stepan Mishura <st...@gmail.com> wrote:
> > > On 5/3/07, Sergey Dmitriev <se...@gmail.com> wrote:
> > > > Guys
> > > >
> > > > could some of you take a look at java.security.KeyPairGenerator?
> > > > It hangs while generating public/private key pair.
> > > >
> > >
> > > The test hands for me on BEA JRockit. I did the following:
> > > 1) modify a test from JIRA - add provider name param to method:
> > > KeyPairGenerator.getInstance("DH", "BC");
> > > 2) copy <classlib>/depends/jars/bcprov-jdk15-136/bcprov.jar to
> > > jre/lib/ext directory
> > > 3) add line to java.security file:
> > > security.provider.7=org.bouncycastle.jce.provider.BouncyCastleProvider
> > >
> > > Could you reproduce it?
> > >
> > > -Stepan.
> > >
> > > > I filed JIRA with respect to this:
> > > > https://issues.apache.org/jira/browse/HARMONY-3789.
> > > >
> > > >
> > > > Thanks
> > > > Sergey


-- 
Stepan Mishura
Intel Enterprise Solutions Software Division

Re: Diffie-Hellman KeyPairGenerator problem

Posted by Sergey Dmitriev <se...@gmail.com>.
Actually I've filed an issue on Bouncy Casle JIRA,
http://www.bouncycastle.org/jira/browse/BJA-19. It is closed as not a
bug.

Thanks, Sergey


On 5/5/07, Sergey Dmitriev <se...@gmail.com> wrote:
> Yes, the case you mentioned hangs on my side as well.
>
> Well I've replaced Harmony's math.jar with JRockit's math classes -
> the same picture, it just hangs. It is not about math.  I've taken a
> walk to BC sources and found that it does not actually hangs up - it
> just works very long. The problem is in safe primes generation for DH
> in org.bouncycastle.crypto.generators.DHParametersHelper.generateSafePrimes().
>
> The default values I found there are: strength = 1024 bit, certainty = 20.
>
> Probably some crypto specialists can comment this issue out.
>
> BTW the given testcase comes "back to life" in 12-15 minutes on
> my box.
>
>
> Thank
> Sergey
>
>
> On 5/4/07, Stepan Mishura <st...@gmail.com> wrote:
> > On 5/3/07, Sergey Dmitriev <se...@gmail.com> wrote:
> > > Guys
> > >
> > > could some of you take a look at java.security.KeyPairGenerator?
> > > It hangs while generating public/private key pair.
> > >
> >
> > The test hands for me on BEA JRockit. I did the following:
> > 1) modify a test from JIRA - add provider name param to method:
> > KeyPairGenerator.getInstance("DH", "BC");
> > 2) copy <classlib>/depends/jars/bcprov-jdk15-136/bcprov.jar to
> > jre/lib/ext directory
> > 3) add line to java.security file:
> > security.provider.7=org.bouncycastle.jce.provider.BouncyCastleProvider
> >
> > Could you reproduce it?
> >
> > -Stepan.
> >
> > > I filed JIRA with respect to this:
> > > https://issues.apache.org/jira/browse/HARMONY-3789.
> > >
> > >
> > > Thanks
> > > Sergey
> > >
> >
> >
> > --
> > Stepan Mishura
> > Intel Enterprise Solutions Software Division
> >
>

Re: Diffie-Hellman KeyPairGenerator problem

Posted by Sergey Dmitriev <se...@gmail.com>.
Yes, the case you mentioned hangs on my side as well.

Well I've replaced Harmony's math.jar with JRockit's math classes -
the same picture, it just hangs. It is not about math.  I've taken a
walk to BC sources and found that it does not actually hangs up - it
just works very long. The problem is in safe primes generation for DH
in org.bouncycastle.crypto.generators.DHParametersHelper.generateSafePrimes().

The default values I found there are: strength = 1024 bit, certainty = 20.

Probably some crypto specialists can comment this issue out.

BTW the given testcase comes "back to life" in 12-15 minutes on
my box.


Thank
Sergey


On 5/4/07, Stepan Mishura <st...@gmail.com> wrote:
> On 5/3/07, Sergey Dmitriev <se...@gmail.com> wrote:
> > Guys
> >
> > could some of you take a look at java.security.KeyPairGenerator?
> > It hangs while generating public/private key pair.
> >
>
> The test hands for me on BEA JRockit. I did the following:
> 1) modify a test from JIRA - add provider name param to method:
> KeyPairGenerator.getInstance("DH", "BC");
> 2) copy <classlib>/depends/jars/bcprov-jdk15-136/bcprov.jar to
> jre/lib/ext directory
> 3) add line to java.security file:
> security.provider.7=org.bouncycastle.jce.provider.BouncyCastleProvider
>
> Could you reproduce it?
>
> -Stepan.
>
> > I filed JIRA with respect to this:
> > https://issues.apache.org/jira/browse/HARMONY-3789.
> >
> >
> > Thanks
> > Sergey
> >
>
>
> --
> Stepan Mishura
> Intel Enterprise Solutions Software Division
>

Re: Diffie-Hellman KeyPairGenerator problem

Posted by Stepan Mishura <st...@gmail.com>.
On 5/3/07, Sergey Dmitriev <se...@gmail.com> wrote:
> Guys
>
> could some of you take a look at java.security.KeyPairGenerator?
> It hangs while generating public/private key pair.
>

The test hands for me on BEA JRockit. I did the following:
1) modify a test from JIRA - add provider name param to method:
KeyPairGenerator.getInstance("DH", "BC");
2) copy <classlib>/depends/jars/bcprov-jdk15-136/bcprov.jar to
jre/lib/ext directory
3) add line to java.security file:
security.provider.7=org.bouncycastle.jce.provider.BouncyCastleProvider

Could you reproduce it?

-Stepan.

> I filed JIRA with respect to this:
> https://issues.apache.org/jira/browse/HARMONY-3789.
>
>
> Thanks
> Sergey
>


-- 
Stepan Mishura
Intel Enterprise Solutions Software Division