Initialise context before using it.
[openssl.git] / crypto / evp / p_verify.c
index 6e2e70b382075486b8dcd6f616289596b9dc1fd2..c66d63ccf8597ebf1721551dfa1fb082c93d304e 100644 (file)
@@ -67,8 +67,9 @@ int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf,
        {
        unsigned char m[EVP_MAX_MD_SIZE];
        unsigned int m_len;
-       int i,ok=0,v;
-       MS_STATIC EVP_MD_CTX tmp_ctx;
+       int i = 0,ok = 0,v;
+       EVP_MD_CTX tmp_ctx;
+       EVP_PKEY_CTX *pkctx = NULL;
 
        EVP_MD_CTX_init(&tmp_ctx);
        if (!EVP_MD_CTX_copy_ex(&tmp_ctx,ctx))
@@ -79,7 +80,6 @@ int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf,
 
        if (ctx->digest->flags & EVP_MD_FLAG_PKEY_METHOD_SIGNATURE)
                {
-               EVP_PKEY_CTX *pkctx = NULL;
                i = -1;
                pkctx = EVP_PKEY_CTX_new(pkey, NULL);
                if (!pkctx)