summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/p_sign.c
diff options
context:
space:
mode:
authordjm <>2009-01-09 12:15:52 +0000
committerdjm <>2009-01-09 12:15:52 +0000
commit23f8d96f0f508b8bef2602049feee9c44228d34c (patch)
treea2a7787bc00e8f6a29153b8c6d9eb5e8f73d6269 /src/lib/libcrypto/evp/p_sign.c
parent30562050421d947c3eb3c10edde6e87730b17471 (diff)
downloadopenbsd-23f8d96f0f508b8bef2602049feee9c44228d34c.tar.gz
openbsd-23f8d96f0f508b8bef2602049feee9c44228d34c.tar.bz2
openbsd-23f8d96f0f508b8bef2602049feee9c44228d34c.zip
resolve conflicts
Diffstat (limited to 'src/lib/libcrypto/evp/p_sign.c')
-rw-r--r--src/lib/libcrypto/evp/p_sign.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/lib/libcrypto/evp/p_sign.c b/src/lib/libcrypto/evp/p_sign.c
index e4ae5906f5..bf41a0db68 100644
--- a/src/lib/libcrypto/evp/p_sign.c
+++ b/src/lib/libcrypto/evp/p_sign.c
@@ -84,10 +84,6 @@ int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen,
84 MS_STATIC EVP_MD_CTX tmp_ctx; 84 MS_STATIC EVP_MD_CTX tmp_ctx;
85 85
86 *siglen=0; 86 *siglen=0;
87 EVP_MD_CTX_init(&tmp_ctx);
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);
91 for (i=0; i<4; i++) 87 for (i=0; i<4; i++)
92 { 88 {
93 v=ctx->digest->required_pkey_type[i]; 89 v=ctx->digest->required_pkey_type[i];
@@ -108,7 +104,23 @@ int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen,
108 EVPerr(EVP_F_EVP_SIGNFINAL,EVP_R_NO_SIGN_FUNCTION_CONFIGURED); 104 EVPerr(EVP_F_EVP_SIGNFINAL,EVP_R_NO_SIGN_FUNCTION_CONFIGURED);
109 return(0); 105 return(0);
110 } 106 }
111 return(ctx->digest->sign(ctx->digest->type,m,m_len,sigret,siglen, 107 EVP_MD_CTX_init(&tmp_ctx);
112 pkey->pkey.ptr)); 108 EVP_MD_CTX_copy_ex(&tmp_ctx,ctx);
109 if (ctx->digest->flags & EVP_MD_FLAG_SVCTX)
110 {
111 EVP_MD_SVCTX sctmp;
112 sctmp.mctx = &tmp_ctx;
113 sctmp.key = pkey->pkey.ptr;
114 i = ctx->digest->sign(ctx->digest->type,
115 NULL, -1, sigret, siglen, &sctmp);
116 }
117 else
118 {
119 EVP_DigestFinal_ex(&tmp_ctx,&(m[0]),&m_len);
120 i = ctx->digest->sign(ctx->digest->type,m,m_len,sigret,siglen,
121 pkey->pkey.ptr);
122 }
123 EVP_MD_CTX_cleanup(&tmp_ctx);
124 return i;
113 } 125 }
114 126