Updated Branches:
  refs/heads/master 9861e8042 -> ab7e788f9

[SSHD-273] Add RFC 6668 (HMAC SHA-2) support

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

Branch: refs/heads/master
Commit: ab7e788f9af364da9c90c83ced5a89c359e72d5c
Parents: 9861e80
Author: Guillaume Nodet <[email protected]>
Authored: Thu Jan 23 20:45:44 2014 +0100
Committer: Guillaume Nodet <[email protected]>
Committed: Thu Jan 23 20:45:44 2014 +0100

----------------------------------------------------------------------
 .../org/apache/sshd/common/mac/HMACSHA256.java  | 45 +++++++++++++++++++-
 .../org/apache/sshd/common/mac/HMACSHA512.java  | 45 +++++++++++++++++++-
 2 files changed, 86 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/ab7e788f/sshd-core/src/main/java/org/apache/sshd/common/mac/HMACSHA256.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/common/mac/HMACSHA256.java 
b/sshd-core/src/main/java/org/apache/sshd/common/mac/HMACSHA256.java
index 1c4bfb5..5f70e0b 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/mac/HMACSHA256.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/mac/HMACSHA256.java
@@ -1,7 +1,48 @@
+/*
+ * 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.sshd.common.mac;
 
+import org.apache.sshd.common.Mac;
+import org.apache.sshd.common.NamedFactory;
+
 /**
- * Created by gnodet on 23/01/14.
+ * HMAC-SHA256 <code>Mac</code>
+ *
+ * @author <a href="mailto:[email protected]";>Apache MINA SSHD Project</a>
  */
-public class HMACSHA256 {
+public class HMACSHA256 extends BaseMac {
+
+    /**
+     * Named factory for the HMAC-SHA256 <code>Mac</code>
+     */
+    public static class Factory implements NamedFactory<Mac> {
+
+        public String getName() {
+            return "hmac-sha2-256";
+        }
+
+        public Mac create() {
+            return new HMACSHA256();
+        }
+    }
+
+    public HMACSHA256() {
+        super("HmacSHA256", 32, 32);
+    }
 }

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/ab7e788f/sshd-core/src/main/java/org/apache/sshd/common/mac/HMACSHA512.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/common/mac/HMACSHA512.java 
b/sshd-core/src/main/java/org/apache/sshd/common/mac/HMACSHA512.java
index b53dcc5..e0ac66f 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/mac/HMACSHA512.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/mac/HMACSHA512.java
@@ -1,7 +1,48 @@
+/*
+ * 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.sshd.common.mac;
 
+import org.apache.sshd.common.Mac;
+import org.apache.sshd.common.NamedFactory;
+
 /**
- * Created by gnodet on 23/01/14.
+ * HMAC-SHA512 <code>Mac</code>
+ *
+ * @author <a href="mailto:[email protected]";>Apache MINA SSHD Project</a>
  */
-public class HMACSHA512 {
+public class HMACSHA512 extends BaseMac {
+
+    /**
+     * Named factory for the HMAC-SHA512 <code>Mac</code>
+     */
+    public static class Factory implements NamedFactory<Mac> {
+
+        public String getName() {
+            return "hmac-sha2-512";
+        }
+
+        public Mac create() {
+            return new HMACSHA512();
+        }
+    }
+
+    public HMACSHA512() {
+        super("HmacSHA512", 64, 64);
+    }
 }

Reply via email to