You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Leif Mortenson <le...@tanukisoftware.com> on 2003/01/14 04:15:18 UTC

[Phyre] Jar signing woes under Java 1.4.1_01

I spent the weekend playing around with getting WebStart working
using the Phyre application for phoenix. The last hurdle that I came across
was an a security error while trying to load xml-apis.jar.

It turns out that the error was caused due a bug(?) in jarsigner in 1.4.1_01
It appears that jarsigner has problems with jars which already have manifest
entries for directories. This is a reported bug on the sun site:
http://developer.java.sun.com/developer/bugParade/bugs/4739089.html
But the problem is that Sun has closed it. I was able to get things working
by falling back and using the version of jarsigner that comes with 1.3.1_03.

This is my first foray into signing jars so I was wondering if anyone
with more
experience might have some advice. It would be nice to be able to the entire
build using 1.4.1

Thanks,
Leif


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Phyre] Jar signing woes under Java 1.4.1_01

Posted by Stephen McConnell <mc...@apache.org>.
Leif:

Gary Shea has (Avalon Users List) has been hitting the same problem 
(unsigned manifest entiries). I've been doing some reactive changes in 
Merlin to handle scanning of jar files using some alternative strategies 
to manifest lookup - but its still playing around time.  The objective 
is to get to manifest independent loading strategy without sacrificing 
performance though unnecary scanning - and also - to enable scanning 
indpendely of the need to lauch an XML parser.  OK - this is probably no 
immediate help - but its a hint at what happening around the issue.

Cheers, Steve.

Leif Mortenson wrote:

>I spent the weekend playing around with getting WebStart working
>using the Phyre application for phoenix. The last hurdle that I came across
>was an a security error while trying to load xml-apis.jar.
>
>It turns out that the error was caused due a bug(?) in jarsigner in 1.4.1_01
>It appears that jarsigner has problems with jars which already have manifest
>entries for directories. This is a reported bug on the sun site:
>http://developer.java.sun.com/developer/bugParade/bugs/4739089.html
>But the problem is that Sun has closed it. I was able to get things working
>by falling back and using the version of jarsigner that comes with 1.3.1_03.
>
>This is my first foray into signing jars so I was wondering if anyone
>with more
>experience might have some advice. It would be nice to be able to the entire
>build using 1.4.1
>
>Thanks,
>Leif
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>  
>

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org
http://www.osm.net




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Phyre] Jar signing woes under Java 1.4.1_01

Posted by Leif Mortenson <le...@tanukisoftware.com>.
Gary Shea wrote:

>Hi Leif --
>
>I just found this old email in my drafts folder, whoops!
>
>What's going on with the signing stuff?  Have you discovered anything
>interesting recently?
>
No I had not figured anything new out.  The problem does seem to be 
caused by
bad entries in the manifest file.  Using the old jarsigner seems to 
work, so that is
what I had been doing. :-/

Cheers,
Leif



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


Re: [Phyre] Jar signing woes under Java 1.4.1_01

Posted by Peter Royal <pr...@apache.org>.
just a note on phyre, it may end up being stillborn, i found this 
recently:

http://mc4j.sourceforge.net/

always easier to build upon someone else's shoulders :) ... they're 
talking about adding pluggable "dashboards".. one of which we could 
create for phoenix (and other avalon components/containers)
-pete

-- 
peter royal -> proyal@apache.org


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


Re: [Phyre] Jar signing woes under Java 1.4.1_01

Posted by Gary Shea <sh...@gtsdesign.com>.
Hi Leif --

I just found this old email in my drafts folder, whoops!

What's going on with the signing stuff?  Have you discovered anything
interesting recently?

Antique comments from original mail inline...

On Tue, 14 Jan 2003, at 16:20 [+0900], Leif Mortenson (leiflists@tanukisoft...:

> Gary Shea wrote:
>
> >Hey Leif --
> >
> >I have been through the same exercise recently.  I suspect that Sun
> >decided that problem is in WebStart, but I'm not sure.  That was my
> >take on it, but I didn't realize that an earlier version of jarsigner
> >actually 'signed' the directory entries.  That doesn't make a lot of
> >sense to me... how do you compute a digest on a directory?  Anyway, I
> >went through all the bugs at WebStart, didn't find a corresponding one,
> >so I added it.  It appears to still be in the internal review phase.
> >
> Looking at the two signed versions, it looks like they both sign the
> directories.  As you
> say, what exactly they are computing the digest on, I am not sure.
>
> What is the bug that you added?
>
> >As a short-term fix, I ran some tests with all the non-file entries
> >stripped out of xml-api.jar's manifest, and as I recall it worked.
> >That was using merlin, though, not phoenix.
> >
> >Hardly a satisfactory solution...
> >
> I don't think that this has anything to do with Phoenix at all.  Phyre
> simply has a block
> which resoponds to requests for the individual jar files used by the
> WebStart and
> then sends them to the client as is.  The security error is happening
> within WebStart.

Right.  What I'm saying is that when I removed that troublesome entry
from the xml-api manifest, my code still worked fine.  But I only tested
it with merlin.  I'm assuming that neither merlin nor phoenix need that
entry in the manifest, but since I know nothing about phoenix, I could
be wrong!

I found the troublesome entries by removing every entry (I thought that
I found several but maybe that's wrong...) which had no evidence of
being signed.

>
> I am attaching the manifest.mf files from the original xml-api.jar, the
> xml-api.jar signed
> using v1.3.1_03 and the version signed using v1.4.1_01
>
> It was a $%$@! to figure out what the differences were because they go
> and write
> the resulting manifests in completely different orders, but the problem
> appears to be
> the following entry in the original file:
>
> ---
> Name: org/apache/xmlcommons/Version
> Implementation-Vendor: Apache Software Foundation
> Implementation-URL: http://xml.apache.org/commons/
> Comment: XmlCommons for http://xml.apache.org/ subproject's use
> Implementation-Title: org.apache.xmlcommons.Version
> Implementation-Version: 1.0.b2
> ---
>
> In the version signed by 1.4.1_01 it looks as follows:
> (Unmodified other than order)
> ---
> Name: org/apache/xmlcommons/Version
> Implementation-Title: org.apache.xmlcommons.Version
> Comment: XmlCommons for http://xml.apache.org/ subproject's use
> Implementation-Version: 1.0.b2
> Implementation-Vendor: Apache Software Foundation
> Implementation-URL: http://xml.apache.org/commons/
> ---
>
> But in the 1.3.1_03 file this entry was completely ommitted.
>
> I have not checked to make sure there are no other changes, but that makes
> up for the 7 line difference in the two files' sizes.
>
>
> Now.  Looking in the actual xml-api.jar file.  There is not a directory
> with that name.
> There is a single class in the parent directory called:
> org/apache/xmlcommons/Version.class
>
> This makes me wonder if this is a bug in the original manifest in the
> xml-api.jar file?
>
> Cheers,
> Leif

A similar situation came up where I had an entry in one of my jar
manifests for a file that did not exist (it was my mistake of course).
jarsigner did not sign it, and of course web start freaked out.  Exactly
the kind of problem we're having with that

So...
it sounds like that old jarsigner or jar program stripped out manifest
entries for non-existant paths.  Apparently this turned out to be
problematic behaviour, as they pulled it out again.  Too bad for us!

	Gary



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


Re: [Phyre] Jar signing woes under Java 1.4.1_01

Posted by Leif Mortenson <le...@tanukisoftware.com>.
Gary Shea wrote:

>Hey Leif --
>
>I have been through the same exercise recently.  I suspect that Sun
>decided that problem is in WebStart, but I'm not sure.  That was my
>take on it, but I didn't realize that an earlier version of jarsigner
>actually 'signed' the directory entries.  That doesn't make a lot of
>sense to me... how do you compute a digest on a directory?  Anyway, I
>went through all the bugs at WebStart, didn't find a corresponding one,
>so I added it.  It appears to still be in the internal review phase.
>
Looking at the two signed versions, it looks like they both sign the 
directories.  As you
say, what exactly they are computing the digest on, I am not sure.

What is the bug that you added?

>As a short-term fix, I ran some tests with all the non-file entries
>stripped out of xml-api.jar's manifest, and as I recall it worked.
>That was using merlin, though, not phoenix.
>
>Hardly a satisfactory solution...
>
I don't think that this has anything to do with Phoenix at all.  Phyre 
simply has a block
which resoponds to requests for the individual jar files used by the 
WebStart and
then sends them to the client as is.  The security error is happening 
within WebStart.

I am attaching the manifest.mf files from the original xml-api.jar, the 
xml-api.jar signed
using v1.3.1_03 and the version signed using v1.4.1_01

It was a $%$@! to figure out what the differences were because they go 
and write
the resulting manifests in completely different orders, but the problem 
appears to be
the following entry in the original file:

---
Name: org/apache/xmlcommons/Version
Implementation-Vendor: Apache Software Foundation
Implementation-URL: http://xml.apache.org/commons/
Comment: XmlCommons for http://xml.apache.org/ subproject's use
Implementation-Title: org.apache.xmlcommons.Version
Implementation-Version: 1.0.b2
---

In the version signed by 1.4.1_01 it looks as follows:
(Unmodified other than order)
---
Name: org/apache/xmlcommons/Version
Implementation-Title: org.apache.xmlcommons.Version
Comment: XmlCommons for http://xml.apache.org/ subproject's use
Implementation-Version: 1.0.b2
Implementation-Vendor: Apache Software Foundation
Implementation-URL: http://xml.apache.org/commons/
---

But in the 1.3.1_03 file this entry was completely ommitted.

I have not checked to make sure there are no other changes, but that makes
up for the 7 line difference in the two files' sizes.


Now.  Looking in the actual xml-api.jar file.  There is not a directory 
with that name.
There is a single class in the parent directory called:
org/apache/xmlcommons/Version.class

This makes me wonder if this is a bug in the original manifest in the 
xml-api.jar file?

Cheers,
Leif


Re: [Phyre] Jar signing woes under Java 1.4.1_01

Posted by Gary Shea <sh...@gtsdesign.com>.
Hey Leif --

I have been through the same exercise recently.  I suspect that Sun
decided that problem is in WebStart, but I'm not sure.  That was my
take on it, but I didn't realize that an earlier version of jarsigner
actually 'signed' the directory entries.  That doesn't make a lot of
sense to me... how do you compute a digest on a directory?  Anyway, I
went through all the bugs at WebStart, didn't find a corresponding one,
so I added it.  It appears to still be in the internal review phase.

As a short-term fix, I ran some tests with all the non-file entries
stripped out of xml-api.jar's manifest, and as I recall it worked.
That was using merlin, though, not phoenix.

Hardly a satisfactory solution...

	Gary

On Tue, 14 Jan 2003, at 12:15 [+0900], Leif Mortenson (leiflists@tanukisoft...:

> I spent the weekend playing around with getting WebStart working
> using the Phyre application for phoenix. The last hurdle that I came across
> was an a security error while trying to load xml-apis.jar.
>
> It turns out that the error was caused due a bug(?) in jarsigner in 1.4.1_01
> It appears that jarsigner has problems with jars which already have manifest
> entries for directories. This is a reported bug on the sun site:
> http://developer.java.sun.com/developer/bugParade/bugs/4739089.html
> But the problem is that Sun has closed it. I was able to get things working
> by falling back and using the version of jarsigner that comes with 1.3.1_03.
>
> This is my first foray into signing jars so I was wondering if anyone
> with more
> experience might have some advice. It would be nice to be able to the entire
> build using 1.4.1
>
> Thanks,
> Leif
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>