directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject [13/50] [abbrv] directory-kerby git commit: DIRKRB-369 Fix findbugs Problems for kerby-provider module. Contributed by Yaning
Date Thu, 30 Jul 2015 06:24:20 GMT
DIRKRB-369 Fix findbugs Problems for kerby-provider module. Contributed by Yaning


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

Branch: refs/heads/pkinit-support
Commit: bba567d37ed5abfb9f63eab2109debdeea2ab7a8
Parents: 2b72ce3
Author: Lin <linchen7@foxmail.com>
Authored: Wed Jul 15 21:36:05 2015 +0800
Committer: Lin <linchen7@foxmail.com>
Committed: Wed Jul 15 21:36:05 2015 +0800

----------------------------------------------------------------------
 .../org/apache/kerby/kerberos/provider/token/JwtTokenDecoder.java | 3 ++-
 .../org/apache/kerby/kerberos/provider/token/JwtTokenEncoder.java | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bba567d3/kerby-provider/token-provider/src/main/java/org/apache/kerby/kerberos/provider/token/JwtTokenDecoder.java
----------------------------------------------------------------------
diff --git a/kerby-provider/token-provider/src/main/java/org/apache/kerby/kerberos/provider/token/JwtTokenDecoder.java
b/kerby-provider/token-provider/src/main/java/org/apache/kerby/kerberos/provider/token/JwtTokenDecoder.java
index 6d64323..c0a6eed 100644
--- a/kerby-provider/token-provider/src/main/java/org/apache/kerby/kerberos/provider/token/JwtTokenDecoder.java
+++ b/kerby-provider/token-provider/src/main/java/org/apache/kerby/kerberos/provider/token/JwtTokenDecoder.java
@@ -32,6 +32,7 @@ import org.apache.kerby.kerberos.kerb.provider.TokenDecoder;
 import org.apache.kerby.kerberos.kerb.spec.base.AuthToken;
 
 import java.io.IOException;
+import java.nio.charset.Charset;
 import java.security.interfaces.RSAPrivateKey;
 import java.security.interfaces.RSAPublicKey;
 import java.text.ParseException;
@@ -48,7 +49,7 @@ public class JwtTokenDecoder implements TokenDecoder {
 
     @Override
     public AuthToken decodeFromBytes(byte[] content) throws IOException {
-        String tokenStr = new String(content);
+        String tokenStr = new String(content, Charset.forName("UTF-8"));
 
         return decodeFromString(tokenStr);
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bba567d3/kerby-provider/token-provider/src/main/java/org/apache/kerby/kerberos/provider/token/JwtTokenEncoder.java
----------------------------------------------------------------------
diff --git a/kerby-provider/token-provider/src/main/java/org/apache/kerby/kerberos/provider/token/JwtTokenEncoder.java
b/kerby-provider/token-provider/src/main/java/org/apache/kerby/kerberos/provider/token/JwtTokenEncoder.java
index e318e95..5970441 100644
--- a/kerby-provider/token-provider/src/main/java/org/apache/kerby/kerberos/provider/token/JwtTokenEncoder.java
+++ b/kerby-provider/token-provider/src/main/java/org/apache/kerby/kerberos/provider/token/JwtTokenEncoder.java
@@ -37,6 +37,7 @@ import org.apache.kerby.kerberos.kerb.KrbException;
 import org.apache.kerby.kerberos.kerb.provider.TokenEncoder;
 import org.apache.kerby.kerberos.kerb.spec.base.AuthToken;
 
+import java.nio.charset.Charset;
 import java.security.interfaces.RSAPrivateKey;
 import java.security.interfaces.RSAPublicKey;
 import java.text.ParseException;
@@ -54,7 +55,7 @@ public class JwtTokenEncoder implements TokenEncoder {
     @Override
     public byte[] encodeAsBytes(AuthToken token) throws KrbException {
         String tokenStr = encodeAsString(token);
-        return tokenStr.getBytes();
+        return tokenStr.getBytes(Charset.forName("UTF-8"));
     }
 
     @Override


Mime
View raw message