You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Nick Burch <ap...@gagravarr.org> on 2014/11/04 17:26:16 UTC

org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Hi All

I've just tried doing a build from trunk, and I'm seeing one of the ooxml 
security tests failing when I run it on Java 6, but not Java 7. Details 
below, anyone else having this problem?

(We currently only require Java 6, so a test that is Java 7 only is 
problematic for rolling 3.11 beta 3!)

Thanks
Nick

----------------

OpenJDK Runtime Environment (IcedTea6 1.13.5) (6b33-1.13.5-1ubuntu0.12.04)
OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode)

Testsuite: org.apache.poi.poifs.crypt.TestSignatureInfo
Tests run: 9, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.653 sec

Testcase: getSignerUnsigned took 0.204 sec
Testcase: testCertChain took 0.485 sec
Testcase: testManipulation took 0.286 sec
Testcase: testSignSpreadsheet took 0.078 sec
Testcase: getSigner took 0.598 sec
Testcase: testSignSpreadsheetWithSignatureInfo took 0.062 sec
Testcase: testSignEnvelopingDocument took 1.453 sec
Testcase: testNonSha1 took 0.026 sec
         Caused an ERROR
null
java.lang.ArrayIndexOutOfBoundsException
         at 
sun.security.provider.ByteArrayAccess.i2bBig(ByteArrayAccess.java:318)
         at sun.security.provider.SHA2.implDigest(SHA2.java:104)
         at 
sun.security.provider.DigestBase.engineDigest(DigestBase.java:173)
         at 
sun.security.provider.DigestBase.engineDigest(DigestBase.java:152)
         at 
java.security.MessageDigest$Delegate.engineDigest(MessageDigest.java:563)
         at java.security.MessageDigest.digest(MessageDigest.java:340)
         at 
org.apache.jcp.xml.dsig.internal.DigesterOutputStream.getDigestValue(DigesterOutputStream.java:102)
         at 
org.apache.jcp.xml.dsig.internal.dom.DOMReference.transform(DOMReference.java:548)
         at 
org.apache.jcp.xml.dsig.internal.dom.DOMReference.digest(DOMReference.java:356)
         at 
org.apache.jcp.xml.dsig.internal.dom.DOMXMLSignature.digestReference(DOMXMLSignature.java:484)
         at 
org.apache.jcp.xml.dsig.internal.dom.DOMXMLSignature.sign(DOMXMLSignature.java:367)
         at 
org.apache.poi.poifs.crypt.dsig.SignatureInfo.preSign(SignatureInfo.java:476)
         at 
org.apache.poi.poifs.crypt.dsig.SignatureInfo.confirmSignature(SignatureInfo.java:292)
         at 
org.apache.poi.poifs.crypt.TestSignatureInfo.testNonSha1(TestSignatureInfo.java:465)

Testcase: getMultiSigners took 0.041 sec


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by Andreas Beeker <an...@gmx.de>.
On 05.11.2014 22:52, Dominik Stadler wrote:
> Hi,
>
> I tried it locally with the same version of OpenJDK, only on Ubuntu
> 14.04, I get the same error.
>
> Dominik.

org.apache.poi.poifs.crypt.TestAgileEncryptionParameters should be also affected by this bug.
What is its test result?
(Maybe it ran later in the build and therefore didn't show up yet ...)

Btw. I'm just fixing it, i.e. ignoring the AIOOBE ...

Andi.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by Dominik Stadler <do...@gmx.at>.
Hi,

I tried it locally with the same version of OpenJDK, only on Ubuntu
14.04, I get the same error.

Dominik.

On Wed, Nov 5, 2014 at 12:29 PM, Aram Mirzadeh <aw...@mbcli.com> wrote:
> I think this is the same bug that throws off the XSSF column autosizer ...
> we never came up with a test that actually failed on it -- or at least it's
> in the same method/class.
>
> On Wed, Nov 5, 2014 at 5:28 AM, Nick Burch <ap...@gagravarr.org> wrote:
>
>> On Wed, 5 Nov 2014, Dominik Stadler wrote:
>>
>>> The CI builds at https://builds.apache.org/job/POI/ run with JDK 6 and
>>> don't run into this failure:
>>>
>>>  Using Java: 1.6.0_27/1.6.0_27-b07/20.2-b06/Java HotSpot(TM) 64-Bit
>>>>> Server VM from Sun Microsystems Inc. on Windows Server 2008: 6.0
>>>>>
>>>>
>> Hmm, it's still failing on my machine, which both means I can't build the
>> 3.11 beta 3 release candidate, and that other users out there might hit the
>> problem too :( At this point, I'd probably be happy if the code just
>> detected it and threw a "your JVM is just too broken" exception which the
>> test warned about but didn't fail with
>>
>> Latest failure below
>>
>> Thanks
>> Nick
>>
>>
>> Testsuite: org.apache.poi.poifs.crypt.TestSignatureInfo
>> Tests run: 9, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.847 sec
>> Testcase: testCertChain took 0.463 sec
>> Testcase: testManipulation took 0.429 sec
>> Testcase: testSignSpreadsheet took 0.075 sec
>> Testcase: getSigner took 0.611 sec
>> Testcase: testSignSpreadsheetWithSignatureInfo took 0.067 sec
>> Testcase: testSignEnvelopingDocument took 0.555 sec
>> Testcase: testNonSha1 took 0.041 sec
>>         Caused an ERROR
>> null
>> java.lang.ArrayIndexOutOfBoundsException
>>         at sun.security.provider.ByteArrayAccess.i2bBig(
>> ByteArrayAccess.java:318)
>>         at sun.security.provider.SHA2.implDigest(SHA2.java:104)
>>         at sun.security.provider.DigestBase.engineDigest(
>> DigestBase.java:173)
>>         at sun.security.provider.DigestBase.engineDigest(
>> DigestBase.java:152)
>>         at java.security.MessageDigest$Delegate.engineDigest(
>> MessageDigest.java:563)
>>         at java.security.MessageDigest.digest(MessageDigest.java:340)
>>         at sun.security.rsa.RSASignature.getDigestValue(RSASignature.
>> java:148)
>>         at sun.security.rsa.RSASignature.engineSign(RSASignature.java:172)
>>         at java.security.Signature$Delegate.engineSign(Signature.
>> java:1166)
>>         at java.security.Signature.sign(Signature.java:539)
>>         at org.apache.jcp.xml.dsig.internal.dom.DOMSignatureMethod.sign(
>> DOMSignatureMethod.java:285)
>>         at org.apache.jcp.xml.dsig.internal.dom.DOMXMLSignature.
>> sign(DOMXMLSignature.java:398)
>>         at org.apache.poi.poifs.crypt.dsig.SignatureInfo.preSign(
>> SignatureInfo.java:476)
>>         at org.apache.poi.poifs.crypt.dsig.SignatureInfo.confirmSignature(
>> SignatureInfo.java:292)
>>         at org.apache.poi.poifs.crypt.TestSignatureInfo.testNonSha1(
>> TestSignatureInfo.java:465)
>>
>> Testcase: getMultiSigners took 0.042 sec
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
>> For additional commands, e-mail: dev-help@poi.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by Aram Mirzadeh <aw...@mbcli.com>.
I think this is the same bug that throws off the XSSF column autosizer ...
we never came up with a test that actually failed on it -- or at least it's
in the same method/class.

On Wed, Nov 5, 2014 at 5:28 AM, Nick Burch <ap...@gagravarr.org> wrote:

> On Wed, 5 Nov 2014, Dominik Stadler wrote:
>
>> The CI builds at https://builds.apache.org/job/POI/ run with JDK 6 and
>> don't run into this failure:
>>
>>  Using Java: 1.6.0_27/1.6.0_27-b07/20.2-b06/Java HotSpot(TM) 64-Bit
>>>> Server VM from Sun Microsystems Inc. on Windows Server 2008: 6.0
>>>>
>>>
> Hmm, it's still failing on my machine, which both means I can't build the
> 3.11 beta 3 release candidate, and that other users out there might hit the
> problem too :( At this point, I'd probably be happy if the code just
> detected it and threw a "your JVM is just too broken" exception which the
> test warned about but didn't fail with
>
> Latest failure below
>
> Thanks
> Nick
>
>
> Testsuite: org.apache.poi.poifs.crypt.TestSignatureInfo
> Tests run: 9, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.847 sec
> Testcase: testCertChain took 0.463 sec
> Testcase: testManipulation took 0.429 sec
> Testcase: testSignSpreadsheet took 0.075 sec
> Testcase: getSigner took 0.611 sec
> Testcase: testSignSpreadsheetWithSignatureInfo took 0.067 sec
> Testcase: testSignEnvelopingDocument took 0.555 sec
> Testcase: testNonSha1 took 0.041 sec
>         Caused an ERROR
> null
> java.lang.ArrayIndexOutOfBoundsException
>         at sun.security.provider.ByteArrayAccess.i2bBig(
> ByteArrayAccess.java:318)
>         at sun.security.provider.SHA2.implDigest(SHA2.java:104)
>         at sun.security.provider.DigestBase.engineDigest(
> DigestBase.java:173)
>         at sun.security.provider.DigestBase.engineDigest(
> DigestBase.java:152)
>         at java.security.MessageDigest$Delegate.engineDigest(
> MessageDigest.java:563)
>         at java.security.MessageDigest.digest(MessageDigest.java:340)
>         at sun.security.rsa.RSASignature.getDigestValue(RSASignature.
> java:148)
>         at sun.security.rsa.RSASignature.engineSign(RSASignature.java:172)
>         at java.security.Signature$Delegate.engineSign(Signature.
> java:1166)
>         at java.security.Signature.sign(Signature.java:539)
>         at org.apache.jcp.xml.dsig.internal.dom.DOMSignatureMethod.sign(
> DOMSignatureMethod.java:285)
>         at org.apache.jcp.xml.dsig.internal.dom.DOMXMLSignature.
> sign(DOMXMLSignature.java:398)
>         at org.apache.poi.poifs.crypt.dsig.SignatureInfo.preSign(
> SignatureInfo.java:476)
>         at org.apache.poi.poifs.crypt.dsig.SignatureInfo.confirmSignature(
> SignatureInfo.java:292)
>         at org.apache.poi.poifs.crypt.TestSignatureInfo.testNonSha1(
> TestSignatureInfo.java:465)
>
> Testcase: getMultiSigners took 0.042 sec
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>
>

Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by Nick Burch <ap...@gagravarr.org>.
On Fri, 7 Nov 2014, kiwiwings wrote:
> It should be probably "ping -c 4 www.google.com" ... otherwise it's endless
> on Linux.
> Of course in Windows it's called "ping -n 4 ..."

Might be safest to do a url fetch of http://poi.apache.org with a short 
connection timeout?

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by kiwiwings <ki...@apache.org>.
It should be probably "ping -c 4 www.google.com" ... otherwise it's endless
on Linux.
Of course in Windows it's called "ping -n 4 ..."




--
View this message in context: http://apache-poi.1045710.n5.nabble.com/org-apache-poi-poifs-crypt-TestSignatureInfo-failing-on-trunk-on-Java-6-tp5717032p5717073.html
Sent from the POI - Dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by kiwiwings <ki...@apache.org>.
Nick Burch-2 wrote
>      [junit] Running org.apache.poi.poifs.crypt.TestSignatureInfo
> for 20 minutes now! :(
> (I've got internet here!)

I will check it tonight. The hang is probably @ TestSignatureInfo:302:
Process p1 = Runtime.getRuntime().exec("ping www.google.com");

I have to admit, that I added that check after the test ran though on ubuntu
and after I switched back to Windows.
So either set "mockTsp" to true (and disable the runtime check) by default
or please find out why it's hanging on your box.
I tried it with WIFI off / on (at Windows), and it returned immediately.

Andi.



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/org-apache-poi-poifs-crypt-TestSignatureInfo-failing-on-trunk-on-Java-6-tp5717032p5717072.html
Sent from the POI - Dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by Nick Burch <ap...@gagravarr.org>.
On Fri, 7 Nov 2014, Andreas Beeker wrote:
> Now the SignatureInfo Tests runs through (on ubuntu / eclipse) and I've 
> added a check for internet connectivity - in offline mode a mock is 
> used.

I'm not sure the offline part is working. I've just done a svn update and 
tried to run the test. It has been stuck on
     [junit] Running org.apache.poi.poifs.crypt.TestSignatureInfo
for 20 minutes now! :(

(I've got internet here!)

> Btw. initially I ran "ant test" and a few other tests failed ... but 
> maybe there's something wrong with my setup ...

Hmm, they shouldn't do. As long as you've got Ant 1.8+ and Java 1.6+, all 
the unit tests should pass


I'm about to get on a plane, but if you could fix that offline/online test 
in the next, say 18 hours, I can do the beta build tomorrow morning!

Thanks
Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by Dominik Stadler <do...@gmx.at>.
Jup, Done!

Dominik.

On Mon, Nov 10, 2014 at 6:04 PM, Allison, Timothy B. <ta...@mitre.org> wrote:
> Dominik,
>
> The parent system properties are not all added to the ant/JUnit process by default (at least according to println (there's also some documentation, I'm sure) :) ).
>
> I submitted a patch here that passes proxy info to TestSignatureInfo:
>
> https://issues.apache.org/bugzilla/show_bug.cgi?id=57197
>
> If that works for you (I assume you're not behind a proxy), then let's make the change.
>
>         Best,
>
>                 Tim
>
>
>
> -----Original Message-----
> From: Dominik Stadler [mailto:dominik.stadler@gmx.at]
> Sent: Monday, November 10, 2014 10:00 AM
> To: POI Developers List
> Subject: Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?
>
> Theoretically the system properties described at
> https://docs.oracle.com/javase/7/docs/technotes/guides/net/proxies.html
> should work, which ones are you using in ANT_OPTS?
>
> Thanks... Dominik.
>
> On Mon, Nov 10, 2014 at 2:42 PM, Allison, Timothy B. <ta...@mitre.org> wrote:
>> Dominik,
>>   Thank you for switching this to a Java-only connection.  Is there an easy way to get proxy info to that piece of code?  I've included proxy info in:
>>
>> ANT_OPTS (and this clearly works because I'm able to download dependent jars during the build process)
>>
>> And this in .bashrc
>>
>> export http_proxy=http://something_or_other.org:PORT
>> export https_proxy=https://something_or_other.org:PORT
>>
>> I'm getting this exception when I try to build beta3:
>>
>>      [java] 1) testSignEnvelopingDocument(org.apache.poi.poifs.crypt.TestSignatureInfo)java.lang.AssertionError: Only allowing ConnectException here, but had: java.lang.RuntimeException: error while creating a time-stamp: Connection refused
>>      [java]     at org.junit.Assert.fail(Assert.java:88)
>>      [java]     at org.junit.Assert.assertTrue(Assert.java:41)
>>      [java]     at org.apache.poi.poifs.crypt.TestSignatureInfo.testSignEnvelopingDocument(TestSignatureInfo.java:364)
>>
>> -----Original Message-----
>> From: Dominik Stadler [mailto:dominik.stadler@gmx.at]
>> Sent: Friday, November 07, 2014 8:08 AM
>> To: POI Developers List
>> Subject: Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?
>>
>> Hi,
>>
>> On some platforms "ping" runs endlessly unless given some additional
>> commandline parameters! I have changed this to a Java-only connection
>> test, hopefully this works better.
>>
>> Dominik.
>>
>> On Fri, Nov 7, 2014 at 2:25 AM, Andreas Beeker <an...@gmx.de> wrote:
>>> On 06.11.2014 15:56, Nick Burch wrote:
>>>> Do we perhaps need a flag to enable / disable tests which need internet connectivity to work? And/or can we maybe do without having to talk to a remote time server to test with?
>>>
>>> I've used the ubuntu live cd and it worked better than I thought.
>>> Now the SignatureInfo Tests runs through (on ubuntu / eclipse) and I've added a check for internet connectivity - in offline mode a mock is used.
>>> As the timestamp client is necessary for the Xades signatures, I thought it's better to test the provided classes than to mock it by default.
>>> Btw. initially I ran "ant test" and a few other tests failed ... but maybe there's something wrong with my setup ...
>>>
>>> Andi.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
>>> For additional commands, e-mail: dev-help@poi.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
>> For additional commands, e-mail: dev-help@poi.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


RE: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by "Allison, Timothy B." <ta...@mitre.org>.
Dominik,

The parent system properties are not all added to the ant/JUnit process by default (at least according to println (there's also some documentation, I'm sure) :) ).

I submitted a patch here that passes proxy info to TestSignatureInfo:

https://issues.apache.org/bugzilla/show_bug.cgi?id=57197

If that works for you (I assume you're not behind a proxy), then let's make the change.

        Best,

                Tim



-----Original Message-----
From: Dominik Stadler [mailto:dominik.stadler@gmx.at] 
Sent: Monday, November 10, 2014 10:00 AM
To: POI Developers List
Subject: Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Theoretically the system properties described at
https://docs.oracle.com/javase/7/docs/technotes/guides/net/proxies.html
should work, which ones are you using in ANT_OPTS?

Thanks... Dominik.

On Mon, Nov 10, 2014 at 2:42 PM, Allison, Timothy B. <ta...@mitre.org> wrote:
> Dominik,
>   Thank you for switching this to a Java-only connection.  Is there an easy way to get proxy info to that piece of code?  I've included proxy info in:
>
> ANT_OPTS (and this clearly works because I'm able to download dependent jars during the build process)
>
> And this in .bashrc
>
> export http_proxy=http://something_or_other.org:PORT
> export https_proxy=https://something_or_other.org:PORT
>
> I'm getting this exception when I try to build beta3:
>
>      [java] 1) testSignEnvelopingDocument(org.apache.poi.poifs.crypt.TestSignatureInfo)java.lang.AssertionError: Only allowing ConnectException here, but had: java.lang.RuntimeException: error while creating a time-stamp: Connection refused
>      [java]     at org.junit.Assert.fail(Assert.java:88)
>      [java]     at org.junit.Assert.assertTrue(Assert.java:41)
>      [java]     at org.apache.poi.poifs.crypt.TestSignatureInfo.testSignEnvelopingDocument(TestSignatureInfo.java:364)
>
> -----Original Message-----
> From: Dominik Stadler [mailto:dominik.stadler@gmx.at]
> Sent: Friday, November 07, 2014 8:08 AM
> To: POI Developers List
> Subject: Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?
>
> Hi,
>
> On some platforms "ping" runs endlessly unless given some additional
> commandline parameters! I have changed this to a Java-only connection
> test, hopefully this works better.
>
> Dominik.
>
> On Fri, Nov 7, 2014 at 2:25 AM, Andreas Beeker <an...@gmx.de> wrote:
>> On 06.11.2014 15:56, Nick Burch wrote:
>>> Do we perhaps need a flag to enable / disable tests which need internet connectivity to work? And/or can we maybe do without having to talk to a remote time server to test with?
>>
>> I've used the ubuntu live cd and it worked better than I thought.
>> Now the SignatureInfo Tests runs through (on ubuntu / eclipse) and I've added a check for internet connectivity - in offline mode a mock is used.
>> As the timestamp client is necessary for the Xades signatures, I thought it's better to test the provided classes than to mock it by default.
>> Btw. initially I ran "ant test" and a few other tests failed ... but maybe there's something wrong with my setup ...
>>
>> Andi.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
>> For additional commands, e-mail: dev-help@poi.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by Dominik Stadler <do...@gmx.at>.
Theoretically the system properties described at
https://docs.oracle.com/javase/7/docs/technotes/guides/net/proxies.html
should work, which ones are you using in ANT_OPTS?

Thanks... Dominik.

On Mon, Nov 10, 2014 at 2:42 PM, Allison, Timothy B. <ta...@mitre.org> wrote:
> Dominik,
>   Thank you for switching this to a Java-only connection.  Is there an easy way to get proxy info to that piece of code?  I've included proxy info in:
>
> ANT_OPTS (and this clearly works because I'm able to download dependent jars during the build process)
>
> And this in .bashrc
>
> export http_proxy=http://something_or_other.org:PORT
> export https_proxy=https://something_or_other.org:PORT
>
> I'm getting this exception when I try to build beta3:
>
>      [java] 1) testSignEnvelopingDocument(org.apache.poi.poifs.crypt.TestSignatureInfo)java.lang.AssertionError: Only allowing ConnectException here, but had: java.lang.RuntimeException: error while creating a time-stamp: Connection refused
>      [java]     at org.junit.Assert.fail(Assert.java:88)
>      [java]     at org.junit.Assert.assertTrue(Assert.java:41)
>      [java]     at org.apache.poi.poifs.crypt.TestSignatureInfo.testSignEnvelopingDocument(TestSignatureInfo.java:364)
>
> -----Original Message-----
> From: Dominik Stadler [mailto:dominik.stadler@gmx.at]
> Sent: Friday, November 07, 2014 8:08 AM
> To: POI Developers List
> Subject: Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?
>
> Hi,
>
> On some platforms "ping" runs endlessly unless given some additional
> commandline parameters! I have changed this to a Java-only connection
> test, hopefully this works better.
>
> Dominik.
>
> On Fri, Nov 7, 2014 at 2:25 AM, Andreas Beeker <an...@gmx.de> wrote:
>> On 06.11.2014 15:56, Nick Burch wrote:
>>> Do we perhaps need a flag to enable / disable tests which need internet connectivity to work? And/or can we maybe do without having to talk to a remote time server to test with?
>>
>> I've used the ubuntu live cd and it worked better than I thought.
>> Now the SignatureInfo Tests runs through (on ubuntu / eclipse) and I've added a check for internet connectivity - in offline mode a mock is used.
>> As the timestamp client is necessary for the Xades signatures, I thought it's better to test the provided classes than to mock it by default.
>> Btw. initially I ran "ant test" and a few other tests failed ... but maybe there's something wrong with my setup ...
>>
>> Andi.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
>> For additional commands, e-mail: dev-help@poi.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


RE: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by "Allison, Timothy B." <ta...@mitre.org>.
Dominik,
  Thank you for switching this to a Java-only connection.  Is there an easy way to get proxy info to that piece of code?  I've included proxy info in:

ANT_OPTS (and this clearly works because I'm able to download dependent jars during the build process)

And this in .bashrc

export http_proxy=http://something_or_other.org:PORT
export https_proxy=https://something_or_other.org:PORT

I'm getting this exception when I try to build beta3:

     [java] 1) testSignEnvelopingDocument(org.apache.poi.poifs.crypt.TestSignatureInfo)java.lang.AssertionError: Only allowing ConnectException here, but had: java.lang.RuntimeException: error while creating a time-stamp: Connection refused
     [java]     at org.junit.Assert.fail(Assert.java:88)
     [java]     at org.junit.Assert.assertTrue(Assert.java:41)
     [java]     at org.apache.poi.poifs.crypt.TestSignatureInfo.testSignEnvelopingDocument(TestSignatureInfo.java:364)

-----Original Message-----
From: Dominik Stadler [mailto:dominik.stadler@gmx.at] 
Sent: Friday, November 07, 2014 8:08 AM
To: POI Developers List
Subject: Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Hi,

On some platforms "ping" runs endlessly unless given some additional
commandline parameters! I have changed this to a Java-only connection
test, hopefully this works better.

Dominik.

On Fri, Nov 7, 2014 at 2:25 AM, Andreas Beeker <an...@gmx.de> wrote:
> On 06.11.2014 15:56, Nick Burch wrote:
>> Do we perhaps need a flag to enable / disable tests which need internet connectivity to work? And/or can we maybe do without having to talk to a remote time server to test with?
>
> I've used the ubuntu live cd and it worked better than I thought.
> Now the SignatureInfo Tests runs through (on ubuntu / eclipse) and I've added a check for internet connectivity - in offline mode a mock is used.
> As the timestamp client is necessary for the Xades signatures, I thought it's better to test the provided classes than to mock it by default.
> Btw. initially I ran "ant test" and a few other tests failed ... but maybe there's something wrong with my setup ...
>
> Andi.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by Dominik Stadler <do...@gmx.at>.
Hi,

On some platforms "ping" runs endlessly unless given some additional
commandline parameters! I have changed this to a Java-only connection
test, hopefully this works better.

Dominik.

On Fri, Nov 7, 2014 at 2:25 AM, Andreas Beeker <an...@gmx.de> wrote:
> On 06.11.2014 15:56, Nick Burch wrote:
>> Do we perhaps need a flag to enable / disable tests which need internet connectivity to work? And/or can we maybe do without having to talk to a remote time server to test with?
>
> I've used the ubuntu live cd and it worked better than I thought.
> Now the SignatureInfo Tests runs through (on ubuntu / eclipse) and I've added a check for internet connectivity - in offline mode a mock is used.
> As the timestamp client is necessary for the Xades signatures, I thought it's better to test the provided classes than to mock it by default.
> Btw. initially I ran "ant test" and a few other tests failed ... but maybe there's something wrong with my setup ...
>
> Andi.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by Andreas Beeker <an...@gmx.de>.
On 06.11.2014 15:56, Nick Burch wrote:
> Do we perhaps need a flag to enable / disable tests which need internet connectivity to work? And/or can we maybe do without having to talk to a remote time server to test with?

I've used the ubuntu live cd and it worked better than I thought.
Now the SignatureInfo Tests runs through (on ubuntu / eclipse) and I've added a check for internet connectivity - in offline mode a mock is used.
As the timestamp client is necessary for the Xades signatures, I thought it's better to test the provided classes than to mock it by default.
Btw. initially I ran "ant test" and a few other tests failed ... but maybe there's something wrong with my setup ...

Andi.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by Nick Burch <ap...@gagravarr.org>.
On Wed, 5 Nov 2014, Nick Burch wrote:
> On Thu, 6 Nov 2014, Andreas Beeker wrote:
>> another commit ... this is frustrating, as I'm trying to blindly fix 
>> something ... maybe just add an @Ignore if it doesn't work again ... of 
>> course this doesn't help much for people having the same issue and don't 
>> know where the bug comes from ...

I've tweaked the assert, to see why it's failing, and I'm now gettng:

Testcase: testNonSha1 took 0.09 sec
         FAILED
Signature not correctly calculated for sha224
junit.framework.AssertionFailedError: Signature not correctly calculated 
for sha224
         at 
org.apache.poi.poifs.crypt.TestSignatureInfo.testNonSha1(TestSignatureInfo.java:473)


However, I also get another error when I run the test suite offline:

Testcase: testSignEnvelopingDocument took 0.179 sec
         FAILED
Only allowing ConnectException here, but had: java.lang.RuntimeException: 
error while creating a time-stamp: timestamp.comodoca.com
junit.framework.AssertionFailedError: Only allowing ConnectException here, 
but had: java.lang.RuntimeException: error while creating a time-stamp: 
timestamp.comodoca.com
         at 
org.apache.poi.poifs.crypt.TestSignatureInfo.testSignEnvelopingDocument(TestSignatureInfo.java:362)

Do we perhaps need a flag to enable / disable tests which need internet 
connectivity to work? And/or can we maybe do without having to talk to a 
remote time server to test with?

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by Nick Burch <ap...@gagravarr.org>.
On Thu, 6 Nov 2014, Andreas Beeker wrote:
> another commit ... this is frustrating, as I'm trying to blindly fix 
> something ... maybe just add an @Ignore if it doesn't work again ... of 
> course this doesn't help much for people having the same issue and don't 
> know where the bug comes from ...

Testcase: testNonSha1 took 0.073 sec
         FAILED
null
junit.framework.AssertionFailedError
         at 
org.apache.poi.poifs.crypt.TestSignatureInfo.testNonSha1(TestSignatureInfo.java:473)

You might want to grab an ubuntu live cd, "apt-get install openjdk-6-jdk" 
and try to build on that? That might be the simplest way to end up with 
the iffy jvm...

(It's too late now for me to roll 3.11 beta 3, so I can always @Ignore it 
tomorrow if you can't work around it / bail cleanly, so we can cut the RC)

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by Andreas Beeker <an...@gmx.de>.
On 06.11.2014 00:16, Nick Burch wrote:
> Nearly...
>

another commit ... this is frustrating, as I'm trying to blindly fix something ...
maybe just add an @Ignore if it doesn't work again ... of course this doesn't help much for people having
the same issue and don't know where the bug comes from ...

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by Nick Burch <ap...@gagravarr.org>.
On Wed, 5 Nov 2014, Andreas Beeker wrote:
> On 05.11.2014 11:28, Nick Burch wrote:
>> Hmm, it's still failing on my machine, which both means I can't build the 3.11 beta 3 release candidate, and that other users out there might hit the problem too :( At this point, I'd probably be happy if the code just detected it and threw a "your JVM is just too broken" exception which the test warned about but didn't fail with
>
> I've added another workaround and a catch - hopefully it runs through 
> now ...

Nearly...

Testsuite: org.apache.poi.poifs.crypt.TestSignatureInfo
Tests run: 9, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 4.393 sec
Testcase: getSignerUnsigned took 0.195 sec
Testcase: testCertChain took 0.471 sec
Testcase: testManipulation took 0.288 sec
Testcase: testSignSpreadsheet took 0.079 sec
Testcase: getSigner took 0.592 sec
Testcase: testSignSpreadsheetWithSignatureInfo took 0.067 sec
Testcase: testSignEnvelopingDocument took 2.173 sec
Testcase: testNonSha1 took 0.072 sec
         FAILED
null
junit.framework.AssertionFailedError
         at 
org.apache.poi.poifs.crypt.TestSignatureInfo.testNonSha1(TestSignatureInfo.java:473)

Testcase: getMultiSigners took 0.042 sec

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by Andreas Beeker <an...@gmx.de>.
On 05.11.2014 11:28, Nick Burch wrote:
>
> Hmm, it's still failing on my machine, which both means I can't build the 3.11 beta 3 release candidate, and that other users out there might hit the problem too :( At this point, I'd probably be happy if the code just detected it and threw a "your JVM is just too broken" exception which the test warned about but didn't fail with
>

I've added another workaround and a catch - hopefully it runs through now ...

Andi.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by Nick Burch <ap...@gagravarr.org>.
On Wed, 5 Nov 2014, Dominik Stadler wrote:
> The CI builds at https://builds.apache.org/job/POI/ run with JDK 6 and
> don't run into this failure:
>
>>> Using Java: 1.6.0_27/1.6.0_27-b07/20.2-b06/Java HotSpot(TM) 64-Bit Server VM from Sun Microsystems Inc. on Windows Server 2008: 6.0

Hmm, it's still failing on my machine, which both means I can't build the 
3.11 beta 3 release candidate, and that other users out there might hit 
the problem too :( At this point, I'd probably be happy if the code just 
detected it and threw a "your JVM is just too broken" exception which the 
test warned about but didn't fail with

Latest failure below

Thanks
Nick


Testsuite: org.apache.poi.poifs.crypt.TestSignatureInfo
Tests run: 9, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.847 sec
Testcase: testCertChain took 0.463 sec
Testcase: testManipulation took 0.429 sec
Testcase: testSignSpreadsheet took 0.075 sec
Testcase: getSigner took 0.611 sec
Testcase: testSignSpreadsheetWithSignatureInfo took 0.067 sec
Testcase: testSignEnvelopingDocument took 0.555 sec
Testcase: testNonSha1 took 0.041 sec
         Caused an ERROR
null
java.lang.ArrayIndexOutOfBoundsException
         at 
sun.security.provider.ByteArrayAccess.i2bBig(ByteArrayAccess.java:318)
         at sun.security.provider.SHA2.implDigest(SHA2.java:104)
         at 
sun.security.provider.DigestBase.engineDigest(DigestBase.java:173)
         at 
sun.security.provider.DigestBase.engineDigest(DigestBase.java:152)
         at 
java.security.MessageDigest$Delegate.engineDigest(MessageDigest.java:563)
         at java.security.MessageDigest.digest(MessageDigest.java:340)
         at 
sun.security.rsa.RSASignature.getDigestValue(RSASignature.java:148)
         at sun.security.rsa.RSASignature.engineSign(RSASignature.java:172)
         at 
java.security.Signature$Delegate.engineSign(Signature.java:1166)
         at java.security.Signature.sign(Signature.java:539)
         at 
org.apache.jcp.xml.dsig.internal.dom.DOMSignatureMethod.sign(DOMSignatureMethod.java:285)
         at 
org.apache.jcp.xml.dsig.internal.dom.DOMXMLSignature.sign(DOMXMLSignature.java:398)
         at 
org.apache.poi.poifs.crypt.dsig.SignatureInfo.preSign(SignatureInfo.java:476)
         at 
org.apache.poi.poifs.crypt.dsig.SignatureInfo.confirmSignature(SignatureInfo.java:292)
         at 
org.apache.poi.poifs.crypt.TestSignatureInfo.testNonSha1(TestSignatureInfo.java:465)

Testcase: getMultiSigners took 0.042 sec


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by Dominik Stadler <do...@gmx.at>.
The CI builds at https://builds.apache.org/job/POI/ run with JDK 6 and
don't run into this failure:

>> Using Java: 1.6.0_27/1.6.0_27-b07/20.2-b06/Java HotSpot(TM) 64-Bit Server VM from Sun Microsystems Inc. on Windows Server 2008: 6.0

I have now also created a separate build which uses OpenJDK at
https://builds.apache.org/view/POI/job/POI-OpenJDK/, the build is
still running, let's see if the same happens there.

Dominik.

On Wed, Nov 5, 2014 at 12:03 AM, Andreas Beeker <an...@gmx.de> wrote:
> On 04.11.2014 20:33, Nick Burch wrote:
>> Maybe add a catch for it, and log a "your jvm is broken, consider updating" in place of the current failure?
>>
>> That'd let me roll the 3.11 beta 3 release :)
>>
>
> I preferred to add a workaround to use BouncyCastle in this case.
> Btw. I usually have the latest JDK 6 as my development/testing jre, so Windows seems not to be affected.
> I hope the hashing algorithms are not subject to jce policy limitations -
> at least I couldn't find something under http://docs.oracle.com/javase/7/docs/technotes/guides/security/SunProviders.html
>
> Andi.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by Andreas Beeker <an...@gmx.de>.
On 04.11.2014 20:33, Nick Burch wrote:
> Maybe add a catch for it, and log a "your jvm is broken, consider updating" in place of the current failure?
>
> That'd let me roll the 3.11 beta 3 release :)
>

I preferred to add a workaround to use BouncyCastle in this case.
Btw. I usually have the latest JDK 6 as my development/testing jre, so Windows seems not to be affected.
I hope the hashing algorithms are not subject to jce policy limitations -
at least I couldn't find something under http://docs.oracle.com/javase/7/docs/technotes/guides/security/SunProviders.html

Andi.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by Nick Burch <ap...@gagravarr.org>.
On Tue, 4 Nov 2014, kiwiwings wrote:
> I hopefully have time tonight for a closer look. But google says, that 
> it might has to do with JDK itself [1] - at least the line numbers are 
> very close to the stack trace.
>
> It's probably another issue for the to-be-written known issues list ...

Maybe add a catch for it, and log a "your jvm is broken, consider 
updating" in place of the current failure?

That'd let me roll the 3.11 beta 3 release :)

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: org.apache.poi.poifs.crypt.TestSignatureInfo failing on trunk on Java 6?

Posted by kiwiwings <ki...@apache.org>.
I hopefully have time tonight for a closer look. But google says, that it
might has to do with JDK itself [1] -
at least the line numbers are very close to the stack trace.

It's probably another issue for the to-be-written known issues list ...


[1] https://bugzilla.redhat.com/show_bug.cgi?id=1155012



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/org-apache-poi-poifs-crypt-TestSignatureInfo-failing-on-trunk-on-Java-6-tp5717032p5717034.html
Sent from the POI - Dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org