OpenSSL CVS Repository
http://cvs.openssl.org/
____________________________________________________________
________________
Server: cvs.openssl.org Name: Dr.
Stephen Henson
Root: /v/openssl/cvs Email: steve openssl.org
Module: openssl Date:
08-Apr-2007 18:53:50
Branch: HEAD Handle:
2007040817535000
Modified files:
openssl/crypto/evp m_sigver.c
Log:
Fix digest signing so digest type is set after init.
Summary:
Revision Changes Path
1.4 +6 -11 openssl/crypto/evp/m_sigver.c
____________________________________________________________
________________
patch -p0 <<' .'
Index: openssl/crypto/evp/m_sigver.c
============================================================
================
$ cvs diff -u -r1.3 -r1.4 m_sigver.c
--- openssl/crypto/evp/m_sigver.c 8 Apr 2007 13:03:26
-0000 1.3
+++ openssl/crypto/evp/m_sigver.c 8 Apr 2007 16:53:50
-0000 1.4
 -67,24 +67,18 
const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey,
int ver)
{
+ int r = 0;
if (ctx->pctx == NULL)
ctx->pctx = EVP_PKEY_CTX_new(pkey, e);
if (ctx->pctx == NULL)
return 0;
- if (EVP_PKEY_CTX_set_signature_md(ctx->pctx, type)
<= 0)
- return 0;
- if (pctx)
- *pctx = ctx->pctx;
if (ver)
{
if (ctx->pctx->pmeth->verifyctx_init)
{
- int r;
r =
ctx->pctx->pmeth->verifyctx_init(ctx->pctx,
ctx);
if (r <= 0)
return 0;
- if (r == 2)
- return 1;
}
else if (EVP_PKEY_verify_init(ctx->pctx) <= 0)
return 0;
 -93,17 +87,18 
{
if (ctx->pctx->pmeth->signctx_init)
{
- int r;
r =
ctx->pctx->pmeth->signctx_init(ctx->pctx, ctx);
if (r <= 0)
return 0;
- if (r == 2)
- return 1;
}
if (EVP_PKEY_sign_init(ctx->pctx) <= 0)
return 0;
}
- if (!EVP_DigestInit_ex(ctx, type, e))
+ if (EVP_PKEY_CTX_set_signature_md(ctx->pctx, type)
<= 0)
+ return 0;
+ if (pctx)
+ *pctx = ctx->pctx;
+ if ((r != 2) && !EVP_DigestInit_ex(ctx, type,
e))
return 0;
return 1;
}
 .
____________________________________________________________
__________
OpenSSL Project http://www.openssl.org
CVS Repository Commit List
openssl-cvs openssl.org
Automated List Manager
majordomo openssl.org
|