diff options
Diffstat (limited to 'src/lib/libcrypto/evp/p_sign.c')
| -rw-r--r-- | src/lib/libcrypto/evp/p_sign.c | 31 | 
1 files changed, 13 insertions, 18 deletions
| diff --git a/src/lib/libcrypto/evp/p_sign.c b/src/lib/libcrypto/evp/p_sign.c index 073270ce31..e4ae5906f5 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 | 
| 66 | void EVP_SignInit(ctx,type) | 66 | void EVP_SignInit(EVP_MD_CTX *ctx, EVP_MD *type) | 
| 67 | EVP_MD_CTX *ctx; | ||
| 68 | EVP_MD *type; | ||
| 69 | { | 67 | { | 
| 70 | EVP_DigestInit(ctx,type); | 68 | EVP_DigestInit_ex(ctx,type); | 
| 71 | } | 69 | } | 
| 72 | 70 | ||
| 73 | void EVP_SignUpdate(ctx,data,count) | 71 | void EVP_SignUpdate(EVP_MD_CTX *ctx, unsigned char *data, | 
| 74 | EVP_MD_CTX *ctx; | 72 | unsigned int count) | 
| 75 | unsigned char *data; | ||
| 76 | unsigned int count; | ||
| 77 | { | 73 | { | 
| 78 | EVP_DigestUpdate(ctx,data,count); | 74 | EVP_DigestUpdate(ctx,data,count); | 
| 79 | } | 75 | } | 
| 80 | #endif | 76 | #endif | 
| 81 | 77 | ||
| 82 | int EVP_SignFinal(ctx,sigret,siglen,pkey) | 78 | int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, | 
| 83 | EVP_MD_CTX *ctx; | 79 | EVP_PKEY *pkey) | 
| 84 | unsigned char *sigret; | ||
| 85 | unsigned int *siglen; | ||
| 86 | EVP_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,8 +84,10 @@ 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_init(&tmp_ctx); | 
| 95 | EVP_DigestFinal(&tmp_ctx,&(m[0]),&m_len); | 88 | EVP_MD_CTX_copy_ex(&tmp_ctx,ctx); | 
| 89 | EVP_DigestFinal_ex(&tmp_ctx,&(m[0]),&m_len); | ||
| 90 | EVP_MD_CTX_cleanup(&tmp_ctx); | ||
| 96 | for (i=0; i<4; i++) | 91 | for (i=0; i<4; i++) | 
| 97 | { | 92 | { | 
| 98 | v=ctx->digest->required_pkey_type[i]; | 93 | v=ctx->digest->required_pkey_type[i]; | 
