Add PRF preference ctrl to ciphers.
[openssl.git] / crypto / evp / m_dss.c
index 80b4eca1361dc017c9001942271e6fbfdec9435d..48c2689504821fdeeaef5f3f0b06118eab40725e 100644 (file)
 
 #include <stdio.h>
 #include "cryptlib.h"
-#include "evp.h"
-#include "objects.h"
-#include "x509.h"
+#include <openssl/evp.h>
+#include <openssl/objects.h>
+#include <openssl/x509.h>
+#ifndef OPENSSL_NO_DSA
+#include <openssl/dsa.h>
+#endif
 
-static EVP_MD dsa_md=
+#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); }
+
+static const EVP_MD dsa_md=
        {
        NID_dsaWithSHA,
        NID_dsaWithSHA,
        SHA_DIGEST_LENGTH,
-       SHA1_Init,
-       SHA1_Update,
-       SHA1_Final,
+       EVP_MD_FLAG_PKEY_DIGEST,
+       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);
        }
-
+#endif