cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-5705] Removing PUBLIC_KEY type untill actually needed
Date Wed, 30 Apr 2014 10:15:16 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 3af1a795d -> fc4f04e39


[CXF-5705] Removing PUBLIC_KEY type untill actually needed


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/fc4f04e3
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/fc4f04e3
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/fc4f04e3

Branch: refs/heads/master
Commit: fc4f04e39bf1676cafc3ac9c32a366de2e314ae7
Parents: 3af1a79
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Wed Apr 30 11:13:33 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Wed Apr 30 11:14:56 2014 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/rs/security/oauth2/common/ClientKey.java    | 3 +--
 .../cxf/rs/security/oauth2/services/AbstractTokenService.java  | 6 ++----
 2 files changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/fc4f04e3/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/ClientKey.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/ClientKey.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/ClientKey.java
index 4cd9a73..4c888ca 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/ClientKey.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/ClientKey.java
@@ -24,8 +24,7 @@ public class ClientKey implements Serializable {
     private static final long serialVersionUID = 6151645789585333184L;
     public enum Type {
         PASSWORD,
-        X509CERTIFICATE,
-        PUBLIC_KEY
+        X509CERTIFICATE
     }
     
     private String key;

http://git-wip-us.apache.org/repos/asf/cxf/blob/fc4f04e3/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java
index 3e12532..c3b9fef 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java
@@ -159,8 +159,7 @@ public class AbstractTokenService extends AbstractOAuthService {
     
     protected void validateTwoWayTlsClient(SecurityContext sc, TLSSessionInfo tlsSessionInfo,
Client client) {
         ClientKey.Type credType = client.getClientKey().getType();
-        if (credType != ClientKey.Type.X509CERTIFICATE 
-            && credType != ClientKey.Type.PUBLIC_KEY) {
+        if (credType != ClientKey.Type.X509CERTIFICATE) {
             reportInvalidClient();
         } else if (client.getClientKey().getKey() != null) {
             // Client has a Base64 encoded representation of the certificate loaded
@@ -175,8 +174,7 @@ public class AbstractTokenService extends AbstractOAuthService {
         Certificate[] clientCerts = tlsInfo.getPeerCertificates();
         try {
             X509Certificate cert = (X509Certificate)clientCerts[0];
-            byte[] encodedKey = type == ClientKey.Type.PUBLIC_KEY 
-                ? cert.getPublicKey().getEncoded() : cert.getEncoded();
+            byte[] encodedKey = cert.getEncoded();
             byte[] clientKey = Base64Utility.decode(base64EncodedCert);
             if (Arrays.equals(encodedKey, clientKey)) {
                 return;


Mime
View raw message