[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[higgins-dev] Patch for Eclipse Bug 234834
|
Title: Patch for Eclipse Bug 234834
Hi, Mike.
I created patch for fixing Eclipse Bug 234834. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=234834)
It needs some changes in sts classes.
Please, review my changes and approve them.
Thank you for your time.
Regards,
Artem Verkhovets
### Eclipse Workspace Patch 1.0
#P org.eclipse.higgins.sts.client
Index: src/org/eclipse/higgins/sts/client/PPIDHelper.java
===================================================================
--- src/org/eclipse/higgins/sts/client/PPIDHelper.java (revision 20457)
+++ src/org/eclipse/higgins/sts/client/PPIDHelper.java (working copy)
@@ -39,7 +39,8 @@
// get relying party identifier
byte[] relyingPartyId = RelyingPartyIdentifierHelper.getRelyingPartyIdentifier(rp, certStore);
- md.update(relyingPartyId);
+ if (relyingPartyId != null)
+ md.update(relyingPartyId);
md.update(canonicalCardId);
log.info("CardID: " + org.eclipse.higgins.sts.utilities.KeyGenHelper.byteArrayToHexString(canonicalCardId));
Index: src/org/eclipse/higgins/sts/client/TokenRequestFactory.java
===================================================================
--- src/org/eclipse/higgins/sts/client/TokenRequestFactory.java (revision 20457)
+++ src/org/eclipse/higgins/sts/client/TokenRequestFactory.java (working copy)
@@ -130,9 +130,13 @@
(informationCard,
certRelyingPartyChain,
certStore)));
- final String strCertificate = new String
+ String strCertificate = null;
+ if (certRelyingPartyChain != null && certRelyingPartyChain.length > 0)
+ {
+ strCertificate = new String
(org.apache.commons.codec.binary.Base64.encodeBase64
(certRelyingPartyChain[0].getEncoded()));
+ }
final String strClientPseudonym = "<ic:ClientPseudonym xmlns:ic=\"http://schemas.xmlsoap.org/ws/2005/05/identity\">"
+ "<ic:PPID>"
+ strPPID
Index: src/org/eclipse/higgins/sts/client/RelyingPartyIdentifierHelper.java
===================================================================
--- src/org/eclipse/higgins/sts/client/RelyingPartyIdentifierHelper.java (revision 20457)
+++ src/org/eclipse/higgins/sts/client/RelyingPartyIdentifierHelper.java (working copy)
@@ -411,7 +411,8 @@
throws Exception {
log.info("getRelyingPartyIdentifier");
-
+ if (rpCertPath == null)
+ return new byte[0];
X509Certificate [] certPath = normalizeCertificateChain(rpCertPath, certStore);
X509Certificate leaf = certPath[0];
@@ -483,6 +484,10 @@
java.security.cert.CertStore certStore)
throws Exception
{
+
+ if (certs == null)
+ return null;
+
java.security.cert.X509CertSelector x509CertSelector = new java.security.cert.X509CertSelector();
java.util.List listCerts = new java.util.ArrayList();
#P org.eclipse.higgins.sts.common
Index: src/org/eclipse/higgins/sts/utilities/KeyGenHelper.java
===================================================================
--- src/org/eclipse/higgins/sts/utilities/KeyGenHelper.java (revision 20457)
+++ src/org/eclipse/higgins/sts/utilities/KeyGenHelper.java (working copy)
@@ -375,7 +375,7 @@
throws Exception
{
int nRounds = 0;
- int nRoundInputByteLength = relyingPartyIdentifier.length + relyingPartyIdentifier.length + 4;
+ int nRoundInputByteLength = masterKey.length + relyingPartyIdentifier.length + 4;
if(1024 == nKeyBitLength)
nRounds = 10;
else