diff options
author | Thomas Watson | 2008-04-10 18:33:56 +0000 |
---|---|---|
committer | Thomas Watson | 2008-04-10 18:33:56 +0000 |
commit | b88f33b57751579390d3c493ac93dab733564860 (patch) | |
tree | b4301e9befcf6a44ce4266b60dfdbac22bd649c2 /bundles/org.eclipse.osgi/security | |
parent | 68fed9f100c6105f2965910fd90e134f8eff2c8c (diff) | |
download | rt.equinox.framework-b88f33b57751579390d3c493ac93dab733564860.tar.gz rt.equinox.framework-b88f33b57751579390d3c493ac93dab733564860.tar.xz rt.equinox.framework-b88f33b57751579390d3c493ac93dab733564860.zip |
Bug 226576 [sec] messages params are reversed for missing files in a signed jar
Diffstat (limited to 'bundles/org.eclipse.osgi/security')
2 files changed, 11 insertions, 5 deletions
diff --git a/bundles/org.eclipse.osgi/security/src/org/eclipse/osgi/internal/signedcontent/SignedBundleFile.java b/bundles/org.eclipse.osgi/security/src/org/eclipse/osgi/internal/signedcontent/SignedBundleFile.java index 24d7c1f87..9067d06a4 100644 --- a/bundles/org.eclipse.osgi/security/src/org/eclipse/osgi/internal/signedcontent/SignedBundleFile.java +++ b/bundles/org.eclipse.osgi/security/src/org/eclipse/osgi/internal/signedcontent/SignedBundleFile.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2007 IBM Corporation and others. + * Copyright (c) 2006, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -107,7 +107,7 @@ public class SignedBundleFile extends BundleFile implements SignedContentConstan // double check that no signer thinks it should exist SignedContentEntry signedEntry = signedContent.getSignedEntry(path); if (signedEntry != null) - throw new SecurityException(NLS.bind(SignedContentMessages.file_is_removed_from_jar, getBaseFile().toString(), path)); + throw new SecurityException(NLS.bind(SignedContentMessages.file_is_removed_from_jar, path, getBaseFile().toString())); return null; } return new SignedBundleEntry(be); diff --git a/bundles/org.eclipse.osgi/security/src/org/eclipse/osgi/internal/signedcontent/SignedContentImpl.java b/bundles/org.eclipse.osgi/security/src/org/eclipse/osgi/internal/signedcontent/SignedContentImpl.java index 5d6ee3384..4753c6844 100644 --- a/bundles/org.eclipse.osgi/security/src/org/eclipse/osgi/internal/signedcontent/SignedContentImpl.java +++ b/bundles/org.eclipse.osgi/security/src/org/eclipse/osgi/internal/signedcontent/SignedContentImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. All rights reserved. + * Copyright (c) 2007, 2008 IBM Corporation and others. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html @@ -155,9 +155,15 @@ public class SignedContentImpl implements SignedContent { BundleFile currentContent = content; if (currentContent == null) throw new InvalidContentException("The content was not set", null); //$NON-NLS-1$ - BundleEntry entry = currentContent.getEntry(entryName); + BundleEntry entry = null; + SecurityException exception = null; + try { + entry = currentContent.getEntry(entryName); + } catch (SecurityException e) { + exception = e; + } if (entry == null) - throw new InvalidContentException(NLS.bind(SignedContentMessages.file_is_removed_from_jar, currentContent.getBaseFile().toString(), entryName), null); + throw new InvalidContentException(NLS.bind(SignedContentMessages.file_is_removed_from_jar, entryName, currentContent.getBaseFile().toString()), exception); entry.getBytes(); } } |