You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by ka...@apache.org on 2007/10/15 14:06:03 UTC

svn commit: r584759 - in /webservices/rampart/trunk/c: include/openssl_hmac.h include/oxs_constants.h src/omxmlsec/openssl/Makefile.am src/omxmlsec/openssl/hmac.c

Author: kaushalye
Date: Mon Oct 15 05:06:02 2007
New Revision: 584759

URL: http://svn.apache.org/viewvc?rev=584759&view=rev
Log:
Adding new modules for the openssl wrapper to support HMAC-SHA1 algorithm

Added:
    webservices/rampart/trunk/c/include/openssl_hmac.h
    webservices/rampart/trunk/c/src/omxmlsec/openssl/hmac.c
Modified:
    webservices/rampart/trunk/c/include/oxs_constants.h
    webservices/rampart/trunk/c/src/omxmlsec/openssl/Makefile.am

Added: webservices/rampart/trunk/c/include/openssl_hmac.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/openssl_hmac.h?rev=584759&view=auto
==============================================================================
--- webservices/rampart/trunk/c/include/openssl_hmac.h (added)
+++ webservices/rampart/trunk/c/include/openssl_hmac.h Mon Oct 15 05:06:02 2007
@@ -0,0 +1,50 @@
+/*
+ *   Copyright 2003-2004 The Apache Software Foundation.
+ *
+ *   Licensed 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.
+ */
+
+#include <openssl/sha.h>
+
+#include <axutil_utils_defines.h>
+#include <axis2_defines.h>
+#include <axutil_env.h>
+#include <oxs_buffer.h>
+
+/**
+  * @file openssl_hmac.h
+  * @brief HMAC function implementations. Supports SHA1  
+  */
+#ifndef OPENSSL_HMAC
+#define OPENSSL_HMAC
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /**
+      * @defgroup openssl_hmac OpenSSL Hmac 
+      * @ingroup openssl
+      * @{
+      */
+
+        AXIS2_EXTERN axis2_status_t AXIS2_CALL
+        openssl_hmac_sha1(const axutil_env_t *env,
+             oxs_buffer_t *secret,
+             oxs_buffer_t *seed); 
+    /* @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif    /* OPENSSL_HMAC */

Modified: webservices/rampart/trunk/c/include/oxs_constants.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/oxs_constants.h?rev=584759&r1=584758&r2=584759&view=diff
==============================================================================
--- webservices/rampart/trunk/c/include/oxs_constants.h (original)
+++ webservices/rampart/trunk/c/include/oxs_constants.h Mon Oct 15 05:06:02 2007
@@ -203,6 +203,12 @@
 #define OXS_HREF_DSA_SHA1          "http://www.w3.org/2000/09/xmldsig#dsa-sha1"
 
     /****************************************************************
+       HMAC
+     ****************************************************************/
+#define OXS_NAME_HMAC_SHA1      "HmacSha1"
+#define OXS_HREF_HMAC_SHA1    "http://www.w3.org/2000/09/xmldsig#hmac-sha1"
+
+    /****************************************************************
        EncryptedKey
     ****************************************************************/
 #define OXS_NAME_ENCRYPTED_KEY         "enc-key"

Modified: webservices/rampart/trunk/c/src/omxmlsec/openssl/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/openssl/Makefile.am?rev=584759&r1=584758&r2=584759&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/openssl/Makefile.am (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/openssl/Makefile.am Mon Oct 15 05:06:02 2007
@@ -1,5 +1,5 @@
 lib_LTLIBRARIES =libomopenssl.la
-libomopenssl_la_SOURCES = cipher_ctx.c crypt.c rsa.c pkey.c util.c cipher_property.c digest.c x509.c pkcs12.c pem.c sign.c
+libomopenssl_la_SOURCES = cipher_ctx.c crypt.c rsa.c pkey.c util.c cipher_property.c digest.c x509.c pkcs12.c pem.c sign.c hmac.c
 
 libomopenssl_la_LIBADD  = -lssl\
     		-lcrypto

Added: webservices/rampart/trunk/c/src/omxmlsec/openssl/hmac.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/openssl/hmac.c?rev=584759&view=auto
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/openssl/hmac.c (added)
+++ webservices/rampart/trunk/c/src/omxmlsec/openssl/hmac.c Mon Oct 15 05:06:02 2007
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+#include <stdio.h>
+#include <openssl/sha.h>
+#include <openssl/md5.h>
+#include <openssl_hmac.h>
+#include <axutil_base64.h>
+#include <axis2_util.h>
+
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+openssl_hmac_sha1(const axutil_env_t *env,
+             oxs_buffer_t *secret,
+             oxs_buffer_t *seed)
+{
+
+    return AXIS2_SUCCESS;
+}
+
+