-/* crypto/srp/srp_lib.c */
/*
* Written by Christophe Renou (christophe.renou@edelweb.fr) with the
* precious help of Peter Sylvester (peter.sylvester@edelweb.fr) for the
if (BN_ucmp(g, N) >= 0)
return NULL;
- ctxt = EVP_MD_CTX_create();
+ ctxt = EVP_MD_CTX_new();
if (ctxt == NULL)
return NULL;
if ((tmp = OPENSSL_malloc(longN)) == NULL)
EVP_DigestFinal_ex(ctxt, digest, NULL);
res = BN_bin2bn(digest, sizeof(digest), NULL);
err:
- EVP_MD_CTX_destroy(ctxt);
+ EVP_MD_CTX_free(ctxt);
return res;
}
{
/* k = SHA1(PAD(A) || PAD(B) ) -- tls-srp draft 8 */
- BIGNUM *u;
+ BIGNUM *u = NULL;
unsigned char cu[SHA_DIGEST_LENGTH];
- unsigned char *cAB;
+ unsigned char *cAB = NULL;
EVP_MD_CTX *ctxt = NULL;
int longN;
if ((A == NULL) || (B == NULL) || (N == NULL))
longN = BN_num_bytes(N);
- ctxt = EVP_MD_CTX_create();
+ ctxt = EVP_MD_CTX_new();
if (ctxt == NULL)
return NULL;
if ((cAB = OPENSSL_malloc(2 * longN)) == NULL)
u = NULL;
}
err:
- EVP_MD_CTX_destroy(ctxt);
+ EVP_MD_CTX_free(ctxt);
return u;
}
if ((s == NULL) || (user == NULL) || (pass == NULL))
return NULL;
- ctxt = EVP_MD_CTX_create();
+ ctxt = EVP_MD_CTX_new();
if (ctxt == NULL)
return NULL;
if ((cs = OPENSSL_malloc(BN_num_bytes(s))) == NULL)
res = BN_bin2bn(dig, sizeof(dig), NULL);
err:
- EVP_MD_CTX_destroy(ctxt);
+ EVP_MD_CTX_free(ctxt);
return res;
}