diff options
Diffstat (limited to 'src/lib/libcrypto/hmac/hmac.h')
-rw-r--r-- | src/lib/libcrypto/hmac/hmac.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/lib/libcrypto/hmac/hmac.h b/src/lib/libcrypto/hmac/hmac.h index e6b43f52c4..0364a1fcbd 100644 --- a/src/lib/libcrypto/hmac/hmac.h +++ b/src/lib/libcrypto/hmac/hmac.h | |||
@@ -58,17 +58,21 @@ | |||
58 | #ifndef HEADER_HMAC_H | 58 | #ifndef HEADER_HMAC_H |
59 | #define HEADER_HMAC_H | 59 | #define HEADER_HMAC_H |
60 | 60 | ||
61 | #ifdef __cplusplus | 61 | #ifdef OPENSSL_NO_HMAC |
62 | extern "C" { | 62 | #error HMAC is disabled. |
63 | #endif | 63 | #endif |
64 | 64 | ||
65 | #include "evp.h" | 65 | #include <openssl/evp.h> |
66 | 66 | ||
67 | #define HMAC_MAX_MD_CBLOCK 64 | 67 | #define HMAC_MAX_MD_CBLOCK 64 |
68 | 68 | ||
69 | #ifdef __cplusplus | ||
70 | extern "C" { | ||
71 | #endif | ||
72 | |||
69 | typedef struct hmac_ctx_st | 73 | typedef struct hmac_ctx_st |
70 | { | 74 | { |
71 | EVP_MD *md; | 75 | const EVP_MD *md; |
72 | EVP_MD_CTX md_ctx; | 76 | EVP_MD_CTX md_ctx; |
73 | EVP_MD_CTX i_ctx; | 77 | EVP_MD_CTX i_ctx; |
74 | EVP_MD_CTX o_ctx; | 78 | EVP_MD_CTX o_ctx; |
@@ -78,26 +82,22 @@ typedef struct hmac_ctx_st | |||
78 | 82 | ||
79 | #define HMAC_size(e) (EVP_MD_size((e)->md)) | 83 | #define HMAC_size(e) (EVP_MD_size((e)->md)) |
80 | 84 | ||
81 | #ifndef NOPROTO | ||
82 | |||
83 | void HMAC_Init(HMAC_CTX *ctx, unsigned char *key, int len, | ||
84 | EVP_MD *md); | ||
85 | void HMAC_Update(HMAC_CTX *ctx,unsigned char *key, int len); | ||
86 | void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); | ||
87 | void HMAC_cleanup(HMAC_CTX *ctx); | ||
88 | unsigned char *HMAC(EVP_MD *evp_md, unsigned char *key, int key_len, | ||
89 | unsigned char *d, int n, unsigned char *md, unsigned int *md_len); | ||
90 | 85 | ||
86 | void HMAC_CTX_init(HMAC_CTX *ctx); | ||
87 | void HMAC_CTX_cleanup(HMAC_CTX *ctx); | ||
91 | 88 | ||
92 | #else | 89 | #define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx) /* deprecated */ |
93 | 90 | ||
94 | void HMAC_Init(); | 91 | void HMAC_Init(HMAC_CTX *ctx, const void *key, int len, |
95 | void HMAC_Update(); | 92 | const EVP_MD *md); /* deprecated */ |
96 | void HMAC_Final(); | 93 | void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, |
97 | void HMAC_cleanup(); | 94 | const EVP_MD *md, ENGINE *impl); |
98 | unsigned char *HMAC(); | 95 | void HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, int len); |
96 | void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); | ||
97 | unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, | ||
98 | const unsigned char *d, int n, unsigned char *md, | ||
99 | unsigned int *md_len); | ||
99 | 100 | ||
100 | #endif | ||
101 | 101 | ||
102 | #ifdef __cplusplus | 102 | #ifdef __cplusplus |
103 | } | 103 | } |