You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ha...@apache.org on 2015/04/30 11:17:54 UTC
directory-kerby git commit: Remove an useless file.
Repository: directory-kerby
Updated Branches:
refs/heads/master d7541cd07 -> 916591dc9
Remove an useless file.
Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/916591dc
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/916591dc
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/916591dc
Branch: refs/heads/master
Commit: 916591dc9528490e7d4194d6f41d02f1a3fb6ef7
Parents: d7541cd
Author: Lin <li...@foxmail.com>
Authored: Thu Apr 30 17:15:22 2015 +0800
Committer: Lin <li...@foxmail.com>
Committed: Thu Apr 30 17:15:22 2015 +0800
----------------------------------------------------------------------
.../kerberos/kerb/crypto/PrfTest.java.orig | 121 -------------------
1 file changed, 121 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/916591dc/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/PrfTest.java.orig
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/PrfTest.java.orig b/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/PrfTest.java.orig
deleted file mode 100644
index b7a2ad0..0000000
--- a/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/PrfTest.java.orig
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.kerby.kerberos.kerb.crypto;
-
-import org.apache.kerby.kerberos.kerb.spec.base.EncryptionType;
-import org.apache.kerby.util.HexUtil;
-import org.junit.Test;
-
-import java.util.Arrays;
-
-import static org.assertj.core.api.Assertions.fail;
-
-public class PrfTest {
- static class TestCase {
- EncryptionType encType;
- String keyData;
- String seed;
- String answer;
- TestCase(EncryptionType encType, String keyData,
- String seed, String answer) {
- this.encType = encType;
- this.keyData = keyData;
- this.seed = seed;
- this.answer = answer;
- }
-
- }
-
- @Test
- public void testPrf_DES_CBC_CRC() throws Exception {
- performTest(new TestCase(
- EncryptionType.DES_CBC_CRC,
- "key1",
- "0161",
- "e91cff96b939270009308b073b66313e"
- ));
- }
-
- @Test
- public void testPrf_DES_CBC_MD4() throws Exception {
- performTest(new TestCase(
- EncryptionType.DES_CBC_MD4,
- "key1",
- "0161",
- "e91cff96b939270009308b073b66313e"
- ));
- }
-
- @Test
- public void testPrf_DES_CBC_MD5() throws Exception {
- performTest(new TestCase(
- EncryptionType.DES_CBC_MD5,
- "key1",
- "0161",
- "e91cff96b939270009308b073b66313e"
- ));
- }
-
- @Test
- public void testPrf_AES128_CTS_HMAC_SHA1() throws Exception {
- performTest(new TestCase(
- EncryptionType.AES128_CTS_HMAC_SHA1_96,
- "key1",
- "0161",
- "77b39a37a868920f2a51f9dd150c5717"
- ));
- }
-
- @Test
- public void testPrf_AES256_CTS_HMAC_SHA1() throws Exception {
- performTest(new TestCase(
- EncryptionType.AES256_CTS_HMAC_SHA1_96,
- "key1",
- "0161",
- "b2628c788e2e9c4a9bb4644678c29f2f"
- ));
- }
-
- @Test
- public void testPrf_DES3_CBC_SHA1() throws Exception {
- performTest(new TestCase(
- EncryptionType.DES3_CBC_SHA1,
- "key1",
- "0161",
- "bb6f4a7caa25fce1ee9baef36f1f9ee7"
- ));
- }
-
- private static void performTest(TestCase testCase) throws Exception {
- byte[] keyData = EncryptionHandler.getEncHandler(testCase.encType).str2key(testCase.keyData, testCase.keyData, null);
- byte[] seed = HexUtil.hex2bytes(testCase.seed);
- byte[] answer = HexUtil.hex2bytes(testCase.answer);
- byte[] outkey = EncryptionHandler.getEncHandler(testCase.encType).prf(keyData, seed);
-
- if (! Arrays.equals(answer, outkey)) {
- System.err.println("failed with:");
- System.err.println("outKey:" + HexUtil.bytesToHex(outkey));
- System.err.println("answer:" + testCase.answer);
- fail("KeyDerive test failed for " + testCase.encType.getName());
- } else {
- System.out.println("Prf test OK for " + testCase.encType.getName());
- }
- }
-}