diff --git a/lib/hcrypto/ChangeLog b/lib/hcrypto/ChangeLog index 9a69c1a50..2daa222cb 100644 --- a/lib/hcrypto/ChangeLog +++ b/lib/hcrypto/ChangeLog @@ -1,5 +1,8 @@ 2008-04-28 Love Hörnquist Åstrand + * evp.[ch]: deprecate functions that are needed for exported + EVP_MD_CTX. + * evp.h: Internalize hc_EVP_MD_CTX. * evp.c: Internalize hc_EVP_MD_CTX. diff --git a/lib/hcrypto/evp.c b/lib/hcrypto/evp.c index c7fde43dd..1ff8c6047 100644 --- a/lib/hcrypto/evp.c +++ b/lib/hcrypto/evp.c @@ -37,6 +37,8 @@ RCSID("$Id$"); +#define HC_DEPRECATED + #include #include #include @@ -142,7 +144,7 @@ EVP_MD_CTX_create(void) * @ingroup hcrypto_evp */ -void +void HC_DEPRECATED EVP_MD_CTX_init(EVP_MD_CTX *ctx) { memset(ctx, 0, sizeof(*ctx)); @@ -173,7 +175,7 @@ EVP_MD_CTX_destroy(EVP_MD_CTX *ctx) * @ingroup hcrypto_evp */ -int +int HC_DEPRECATED EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) { if (ctx->md && ctx->md->cleanup) diff --git a/lib/hcrypto/evp.h b/lib/hcrypto/evp.h index 5e24f9cf7..ccca7ebba 100644 --- a/lib/hcrypto/evp.h +++ b/lib/hcrypto/evp.h @@ -155,6 +155,14 @@ struct hc_CIPHER_CTX { unsigned char final[EVP_MAX_BLOCK_LENGTH]; }; +#if !defined(__GNUC__) && !defined(__attribute__) +#define __attribute__(x) +#endif + +#ifndef HC_DEPRECATED +#define HC_DEPRECATED __attribute__((deprecated)) +#endif + #ifdef __cplusplus extern "C" { #endif @@ -199,9 +207,9 @@ size_t EVP_MD_CTX_block_size(EVP_MD_CTX *); EVP_MD_CTX * EVP_MD_CTX_create(void); -void EVP_MD_CTX_init(EVP_MD_CTX *); +void HC_DEPRECATED EVP_MD_CTX_init(EVP_MD_CTX *); void EVP_MD_CTX_destroy(EVP_MD_CTX *); -int EVP_MD_CTX_cleanup(EVP_MD_CTX *); +int HC_DEPRECATED EVP_MD_CTX_cleanup(EVP_MD_CTX *); int EVP_DigestInit_ex(EVP_MD_CTX *, const EVP_MD *, ENGINE *); int EVP_DigestUpdate(EVP_MD_CTX *,const void *, size_t);