remove ecdsa.h header references.
[openssl.git] / engines / ccgost / gost2001.c
index 5490a5d760f453f85913790877f2f2a15e66818e..b47d832c6d504e28579ddd46c7164f5537373fce 100644 (file)
@@ -7,10 +7,9 @@
  *          Requires OpenSSL 0.9.9 for compilation                    *
  **********************************************************************/
 #include "gost_lcl.h"
-#include "gost_params.h"
 #include <string.h>
 #include <openssl/rand.h>
-#include <openssl/ecdsa.h>
+#include <openssl/ec.h>
 #include <openssl/err.h>
 #include "e_gost_err.h"
 #ifdef DEBUG_SIGN
@@ -109,8 +108,8 @@ int fill_GOST2001_params(EC_KEY *eckey, int nid)
     }
     ok = 1;
  err:
-    if (P) EC_POINT_free(P);
-    if (grp) EC_GROUP_free(grp);
+    EC_POINT_free(P);
+    EC_GROUP_free(grp);
     if (ctx)
         BN_CTX_end(ctx);
     BN_CTX_free(ctx);
@@ -243,7 +242,7 @@ DSA_SIG *gost2001_do_sign(const unsigned char *dgst, int dlen, EC_KEY *eckey)
     if (ctx)
         BN_CTX_end(ctx);
     BN_CTX_free(ctx);
-    if (C) EC_POINT_free(C);
+    EC_POINT_free(C);
     BN_free(md);
     if (!ret)
         DSA_SIG_free(newsig);
@@ -361,7 +360,7 @@ int gost2001_do_verify(const unsigned char *dgst, int dgst_len,
         ok = 1;
     }
  err:
-    if (C) EC_POINT_free(C);
+    EC_POINT_free(C);
     if (ctx)
         BN_CTX_end(ctx);
     BN_CTX_free(ctx);
@@ -393,7 +392,7 @@ int gost2001_compute_public(EC_KEY *ec)
         goto err;
     }
     BN_CTX_start(ctx);
-    if (!(priv_key = EC_KEY_get0_private_key(ec))) {
+    if ((priv_key = EC_KEY_get0_private_key(ec)) == NULL) {
         GOSTerr(GOST_F_GOST2001_COMPUTE_PUBLIC, ERR_R_EC_LIB);
         goto err;
     }
@@ -413,7 +412,7 @@ int gost2001_compute_public(EC_KEY *ec)
     }
     ok = 256;
  err:
-    if (pub_key) EC_POINT_free(pub_key);
+    EC_POINT_free(pub_key);
     if (ctx)
         BN_CTX_end(ctx);
     BN_CTX_free(ctx);