Remove /* foo.c */ comments
[oweals/openssl.git] / crypto / srp / srp_lib.c
index 649d2b5a66524dc69560a8706e6b07e82afa6def..457947b23e2d262c9f640ade57a1cefb6e887d7e 100644 (file)
@@ -1,4 +1,3 @@
-/* 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
@@ -78,7 +77,7 @@ static BIGNUM *srp_Calc_k(BIGNUM *N, BIGNUM *g)
     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)
@@ -98,7 +97,7 @@ static BIGNUM *srp_Calc_k(BIGNUM *N, BIGNUM *g)
     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;
 }
 
@@ -106,9 +105,9 @@ BIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N)
 {
     /* 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))
@@ -119,7 +118,7 @@ BIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N)
 
     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)
@@ -140,7 +139,7 @@ BIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N)
         u = NULL;
     }
  err:
-    EVP_MD_CTX_destroy(ctxt);
+    EVP_MD_CTX_free(ctxt);
 
     return u;
 }
@@ -213,7 +212,7 @@ BIGNUM *SRP_Calc_x(BIGNUM *s, const char *user, const char *pass)
     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)
@@ -234,7 +233,7 @@ BIGNUM *SRP_Calc_x(BIGNUM *s, const char *user, const char *pass)
 
     res = BN_bin2bn(dig, sizeof(dig), NULL);
  err:
-    EVP_MD_CTX_destroy(ctxt);
+    EVP_MD_CTX_free(ctxt);
     return res;
 }