]> git.saurik.com Git - apple/security.git/blobdiff - libsecurity_ssl/lib/tls_hmac.h
Security-55471.14.8.tar.gz
[apple/security.git] / libsecurity_ssl / lib / tls_hmac.h
index 0cc6aa4199f8c55e7209edfa1d9766fda48d03c5..c581b9139401b33bd986695272050b2c571e67d2 100644 (file)
@@ -32,8 +32,8 @@
 extern "C" {
 #endif
 
 extern "C" {
 #endif
 
-#include "ssl.h"
-#include "sslPriv.h"
+#include <sys/types.h>
+#include "cipherSpecs.h"
 
 /* forward declaration of HMAC object */
 struct                                                 HMACReference;
 
 /* forward declaration of HMAC object */
 struct                                                 HMACReference;
@@ -42,56 +42,51 @@ struct                                              HMACReference;
 struct                      HMACContext;
 typedef struct HMACContext  *HMACContextRef;
 
 struct                      HMACContext;
 typedef struct HMACContext  *HMACContextRef;
 
-/* The HMAC algorithms we support */
-typedef enum {
-       HA_Null = 0,            // i.e., uninitialized
-       HA_SHA1,
-       HA_MD5,
-    HA_SHA256,
-    HA_SHA384
-} HMAC_Algs;
 
 /* For convenience..the max size of HMAC, in bytes, this module will ever return */
 #define TLS_HMAC_MAX_SIZE              48
 
 /* Create an HMAC session */
 
 /* For convenience..the max size of HMAC, in bytes, this module will ever return */
 #define TLS_HMAC_MAX_SIZE              48
 
 /* Create an HMAC session */
-typedef OSStatus (*HMAC_AllocFcn) (
+typedef int (*HMAC_AllocFcn) (
        const struct HMACReference      *hmac,
        const struct HMACReference      *hmac,
-       SSLContext                                      *ctx,
        const void                                      *keyPtr,
        size_t                      keyLen,
        HMACContextRef                          *hmacCtx);                      // RETURNED
 
 /* Free a session */
        const void                                      *keyPtr,
        size_t                      keyLen,
        HMACContextRef                          *hmacCtx);                      // RETURNED
 
 /* Free a session */
-typedef OSStatus (*HMAC_FreeFcn) (
-       HMACContextRef  hmacCtx);
-
+typedef int (*HMAC_FreeFcn) (
+       HMACContextRef  hmacCtx);       
+       
 /* Reusable init, using same key */
 /* Reusable init, using same key */
-typedef OSStatus (*HMAC_InitFcn) (
+typedef int (*HMAC_InitFcn) (
        HMACContextRef  hmacCtx);
 
 /* normal crypt ops */
        HMACContextRef  hmacCtx);
 
 /* normal crypt ops */
-typedef OSStatus (*HMAC_UpdateFcn) (
+typedef int (*HMAC_UpdateFcn) (
        HMACContextRef  hmacCtx,
        const void              *data,
        size_t          dataLen);
        HMACContextRef  hmacCtx,
        const void              *data,
        size_t          dataLen);
-
-typedef OSStatus (*HMAC_FinalFcn) (
+       
+typedef int (*HMAC_FinalFcn) (
        HMACContextRef  hmacCtx,
        void                    *hmac,                  // mallocd by caller
        size_t          *hmacLen);              // IN/OUT
 
 /* one-shot */
        HMACContextRef  hmacCtx,
        void                    *hmac,                  // mallocd by caller
        size_t          *hmacLen);              // IN/OUT
 
 /* one-shot */
-typedef OSStatus (*HMAC_HmacFcn) (
+typedef int (*HMAC_HmacFcn) (
        HMACContextRef  hmacCtx,
        const void              *data,
        size_t          dataLen,
        void                    *hmac,                  // mallocd by caller
        size_t          *hmacLen);              // IN/OUT
        HMACContextRef  hmacCtx,
        const void              *data,
        size_t          dataLen,
        void                    *hmac,                  // mallocd by caller
        size_t          *hmacLen);              // IN/OUT
+       
+
+typedef struct HMACParams {
+} HMACParams;
 
 typedef struct HMACReference {
 
 typedef struct HMACReference {
-       size_t          macSize;
-       HMAC_Algs               alg;
+    size_t          macSize;
+    HMAC_Algs          alg;
        HMAC_AllocFcn   alloc;
        HMAC_FreeFcn    free;
        HMAC_InitFcn    init;
        HMAC_AllocFcn   alloc;
        HMAC_FreeFcn    free;
        HMAC_InitFcn    init;
@@ -106,6 +101,7 @@ extern const HMACReference TlsHmacMD5;
 extern const HMACReference TlsHmacSHA256;
 extern const HMACReference TlsHmacSHA384;
 
 extern const HMACReference TlsHmacSHA256;
 extern const HMACReference TlsHmacSHA384;
 
+
 #ifdef __cplusplus
 }
 #endif
 #ifdef __cplusplus
 }
 #endif