summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/p_sign.c
diff options
context:
space:
mode:
authorbeck <>1999-09-29 04:37:45 +0000
committerbeck <>1999-09-29 04:37:45 +0000
commitde8f24ea083384bb66b32ec105dc4743c5663cdf (patch)
tree1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libcrypto/evp/p_sign.c
parentcb929d29896bcb87c2a97417fbd03e50078fc178 (diff)
downloadopenbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip
OpenSSL 0.9.4 merge
Diffstat (limited to 'src/lib/libcrypto/evp/p_sign.c')
-rw-r--r--src/lib/libcrypto/evp/p_sign.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/lib/libcrypto/evp/p_sign.c b/src/lib/libcrypto/evp/p_sign.c
index 073270ce31..1fa32ac17e 100644
--- a/src/lib/libcrypto/evp/p_sign.c
+++ b/src/lib/libcrypto/evp/p_sign.c
@@ -58,32 +58,25 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include "evp.h" 61#include <openssl/evp.h>
62#include "objects.h" 62#include <openssl/objects.h>
63#include "x509.h" 63#include <openssl/x509.h>
64 64
65#ifdef undef 65#ifdef undef
66void EVP_SignInit(ctx,type) 66void EVP_SignInit(EVP_MD_CTX *ctx, EVP_MD *type)
67EVP_MD_CTX *ctx;
68EVP_MD *type;
69 { 67 {
70 EVP_DigestInit(ctx,type); 68 EVP_DigestInit(ctx,type);
71 } 69 }
72 70
73void EVP_SignUpdate(ctx,data,count) 71void EVP_SignUpdate(EVP_MD_CTX *ctx, unsigned char *data,
74EVP_MD_CTX *ctx; 72 unsigned int count)
75unsigned char *data;
76unsigned int count;
77 { 73 {
78 EVP_DigestUpdate(ctx,data,count); 74 EVP_DigestUpdate(ctx,data,count);
79 } 75 }
80#endif 76#endif
81 77
82int EVP_SignFinal(ctx,sigret,siglen,pkey) 78int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen,
83EVP_MD_CTX *ctx; 79 EVP_PKEY *pkey)
84unsigned char *sigret;
85unsigned int *siglen;
86EVP_PKEY *pkey;
87 { 80 {
88 unsigned char m[EVP_MAX_MD_SIZE]; 81 unsigned char m[EVP_MAX_MD_SIZE];
89 unsigned int m_len; 82 unsigned int m_len;
@@ -91,7 +84,7 @@ EVP_PKEY *pkey;
91 MS_STATIC EVP_MD_CTX tmp_ctx; 84 MS_STATIC EVP_MD_CTX tmp_ctx;
92 85
93 *siglen=0; 86 *siglen=0;
94 memcpy(&tmp_ctx,ctx,sizeof(EVP_MD_CTX)); 87 EVP_MD_CTX_copy(&tmp_ctx,ctx);
95 EVP_DigestFinal(&tmp_ctx,&(m[0]),&m_len); 88 EVP_DigestFinal(&tmp_ctx,&(m[0]),&m_len);
96 for (i=0; i<4; i++) 89 for (i=0; i<4; i++)
97 { 90 {