/* crypto/evp/p_verify.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
#include <stdio.h>
#include "cryptlib.h"
-#include "evp.h"
-#include "objects.h"
-#include "x509.h"
+#include <openssl/evp.h>
+#include <openssl/objects.h>
+#include <openssl/x509.h>
-int EVP_VerifyFinal(ctx,sigbuf,siglen,pkey)
-EVP_MD_CTX *ctx;
-unsigned char *sigbuf;
-unsigned int siglen;
-EVP_PKEY *pkey;
+int EVP_VerifyFinal(EVP_MD_CTX *ctx, unsigned char *sigbuf,
+ unsigned int siglen, EVP_PKEY *pkey)
{
unsigned char m[EVP_MAX_MD_SIZE];
unsigned int m_len;
int i,ok=0,v;
+ MS_STATIC EVP_MD_CTX tmp_ctx;
for (i=0; i<4; i++)
{
EVPerr(EVP_F_EVP_VERIFYFINAL,EVP_R_WRONG_PUBLIC_KEY_TYPE);
return(-1);
}
- EVP_DigestFinal(ctx,&(m[0]),&m_len);
+ EVP_MD_CTX_copy(&tmp_ctx,ctx);
+ EVP_DigestFinal(&tmp_ctx,&(m[0]),&m_len);
if (ctx->digest->verify == NULL)
{
EVPerr(EVP_F_EVP_VERIFYFINAL,EVP_R_NO_VERIFY_FUNCTION_CONFIGURED);
return(ctx->digest->verify(ctx->digest->type,m,m_len,
sigbuf,siglen,pkey->pkey.ptr));
}
+