summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/m_dss1.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/evp/m_dss1.c')
-rw-r--r--src/lib/libcrypto/evp/m_dss1.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/lib/libcrypto/evp/m_dss1.c b/src/lib/libcrypto/evp/m_dss1.c
index 9d8d1ce23e..f5668ebda0 100644
--- a/src/lib/libcrypto/evp/m_dss1.c
+++ b/src/lib/libcrypto/evp/m_dss1.c
@@ -56,27 +56,39 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#ifndef NO_SHA 59#ifndef OPENSSL_NO_SHA
60#include <stdio.h> 60#include <stdio.h>
61#include "cryptlib.h" 61#include "cryptlib.h"
62#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/objects.h> 63#include <openssl/objects.h>
64#include <openssl/x509.h> 64#include <openssl/x509.h>
65 65
66static EVP_MD dss1_md= 66static int init(EVP_MD_CTX *ctx)
67 { return SHA1_Init(ctx->md_data); }
68
69static int update(EVP_MD_CTX *ctx,const void *data,unsigned long count)
70 { return SHA1_Update(ctx->md_data,data,count); }
71
72static int final(EVP_MD_CTX *ctx,unsigned char *md)
73 { return SHA1_Final(md,ctx->md_data); }
74
75static const EVP_MD dss1_md=
67 { 76 {
68 NID_dsa, 77 NID_dsa,
69 NID_dsaWithSHA1, 78 NID_dsaWithSHA1,
70 SHA_DIGEST_LENGTH, 79 SHA_DIGEST_LENGTH,
71 SHA1_Init, 80 0,
72 SHA1_Update, 81 init,
73 SHA1_Final, 82 update,
83 final,
84 NULL,
85 NULL,
74 EVP_PKEY_DSA_method, 86 EVP_PKEY_DSA_method,
75 SHA_CBLOCK, 87 SHA_CBLOCK,
76 sizeof(EVP_MD *)+sizeof(SHA_CTX), 88 sizeof(EVP_MD *)+sizeof(SHA_CTX),
77 }; 89 };
78 90
79EVP_MD *EVP_dss1(void) 91const EVP_MD *EVP_dss1(void)
80 { 92 {
81 return(&dss1_md); 93 return(&dss1_md);
82 } 94 }