X-Git-Url: https://git.openssl.org/gitweb/?a=blobdiff_plain;f=crypto%2Fevp%2Fm_dss.c;h=a948c77fa497a2bf8fc35f574ea333c1fbd0cd9f;hb=2802ec65c20b86332a55a2dd114b8d9bf60411ae;hp=8ea826868eab319343872ee9d5cdb406fcd6a5d8;hpb=d02f751ce1d13183a0c0e5528ec89f76587ed989;p=openssl.git diff --git a/crypto/evp/m_dss.c b/crypto/evp/m_dss.c index 8ea826868e..a948c77fa4 100644 --- a/crypto/evp/m_dss.c +++ b/crypto/evp/m_dss.c @@ -61,22 +61,38 @@ #include #include #include +#ifndef OPENSSL_NO_DSA +#include +#endif + +#ifndef OPENSSL_NO_SHA + +static int init(EVP_MD_CTX *ctx) + { return SHA1_Init(ctx->md_data); } + +static int update(EVP_MD_CTX *ctx,const void *data,size_t count) + { return SHA1_Update(ctx->md_data,data,count); } + +static int final(EVP_MD_CTX *ctx,unsigned char *md) + { return SHA1_Final(md,ctx->md_data); } -#ifndef NO_SHA -static EVP_MD dsa_md= +static const EVP_MD dsa_md= { NID_dsaWithSHA, NID_dsaWithSHA, SHA_DIGEST_LENGTH, - SHA1_Init, - SHA1_Update, - SHA1_Final, + 0, + init, + update, + final, + NULL, + NULL, EVP_PKEY_DSA_method, SHA_CBLOCK, sizeof(EVP_MD *)+sizeof(SHA_CTX), }; -EVP_MD *EVP_dss(void) +const EVP_MD *EVP_dss(void) { return(&dsa_md); }