OLD | NEW |
1 /* crypto/evp/m_dss1.c */ | 1 /* crypto/evp/m_dss1.c */ |
2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * This package is an SSL implementation written | 5 * This package is an SSL implementation written |
6 * by Eric Young (eay@cryptsoft.com). | 6 * by Eric Young (eay@cryptsoft.com). |
7 * The implementation was written so as to conform with Netscapes SSL. | 7 * The implementation was written so as to conform with Netscapes SSL. |
8 * | 8 * |
9 * This library is free for commercial and non-commercial use as long as | 9 * This library is free for commercial and non-commercial use as long as |
10 * the following conditions are aheared to. The following conditions | 10 * the following conditions are aheared to. The following conditions |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 #ifndef OPENSSL_NO_SHA | 62 #ifndef OPENSSL_NO_SHA |
63 | 63 |
64 #include <openssl/evp.h> | 64 #include <openssl/evp.h> |
65 #include <openssl/objects.h> | 65 #include <openssl/objects.h> |
66 #include <openssl/x509.h> | 66 #include <openssl/x509.h> |
67 #ifndef OPENSSL_NO_DSA | 67 #ifndef OPENSSL_NO_DSA |
68 #include <openssl/dsa.h> | 68 #include <openssl/dsa.h> |
69 #endif | 69 #endif |
70 | 70 |
71 #ifndef OPENSSL_FIPS | |
72 | |
73 static int init(EVP_MD_CTX *ctx) | 71 static int init(EVP_MD_CTX *ctx) |
74 { return SHA1_Init(ctx->md_data); } | 72 { return SHA1_Init(ctx->md_data); } |
75 | 73 |
76 static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 74 static int update(EVP_MD_CTX *ctx,const void *data,size_t count) |
77 { return SHA1_Update(ctx->md_data,data,count); } | 75 { return SHA1_Update(ctx->md_data,data,count); } |
78 | 76 |
79 static int final(EVP_MD_CTX *ctx,unsigned char *md) | 77 static int final(EVP_MD_CTX *ctx,unsigned char *md) |
80 { return SHA1_Final(md,ctx->md_data); } | 78 { return SHA1_Final(md,ctx->md_data); } |
81 | 79 |
82 static const EVP_MD dss1_md= | 80 static const EVP_MD dss1_md= |
83 { | 81 { |
84 NID_dsa, | 82 NID_dsa, |
85 NID_dsaWithSHA1, | 83 NID_dsaWithSHA1, |
86 SHA_DIGEST_LENGTH, | 84 SHA_DIGEST_LENGTH, |
87 » 0, | 85 » EVP_MD_FLAG_PKEY_DIGEST, |
88 init, | 86 init, |
89 update, | 87 update, |
90 final, | 88 final, |
91 NULL, | 89 NULL, |
92 NULL, | 90 NULL, |
93 EVP_PKEY_DSA_method, | 91 EVP_PKEY_DSA_method, |
94 SHA_CBLOCK, | 92 SHA_CBLOCK, |
95 sizeof(EVP_MD *)+sizeof(SHA_CTX), | 93 sizeof(EVP_MD *)+sizeof(SHA_CTX), |
96 }; | 94 }; |
97 | 95 |
98 const EVP_MD *EVP_dss1(void) | 96 const EVP_MD *EVP_dss1(void) |
99 { | 97 { |
100 return(&dss1_md); | 98 return(&dss1_md); |
101 } | 99 } |
102 #endif | 100 #endif |
103 #endif | |
OLD | NEW |