You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by dr...@apache.org on 2015/04/23 10:39:10 UTC

[2/2] directory-kerby git commit: DIRKRB-219 Implement random2Key function in Rc4KeyMaker. Contributed by Yaning

DIRKRB-219 Implement random2Key function in Rc4KeyMaker. 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/39ce3273
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/39ce3273
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/39ce3273

Branch: refs/heads/master
Commit: 39ce327318dfe1d52726f4778bb3d23c6ecbfbf2
Parents: 994f4f0
Author: Drankye <dr...@gmail.com>
Authored: Fri Apr 24 00:28:12 2015 +0800
Committer: Drankye <dr...@gmail.com>
Committed: Fri Apr 24 00:28:12 2015 +0800

----------------------------------------------------------------------
 .../apache/kerby/kerberos/kerb/crypto/key/Rc4KeyMaker.java  | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/39ce3273/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/key/Rc4KeyMaker.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/key/Rc4KeyMaker.java b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/key/Rc4KeyMaker.java
index 85e8ba2..c362aad 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/key/Rc4KeyMaker.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/key/Rc4KeyMaker.java
@@ -49,4 +49,11 @@ public class Rc4KeyMaker extends AbstractKeyMaker {
         }
     }
 
-}
+    @Override
+    public byte[] random2Key(byte[] randomBits) throws KrbException {
+        if (randomBits.length != encProvider().keyInputSize()) {
+            throw new KrbException("Invalid random bits, not of correct bytes size");
+        }
+        return randomBits;
+    }
+}
\ No newline at end of file