crypto/seed: add small-footprint path.
[openssl.git] / crypto / dsa / dsa_depr.c
index b3d0fab14b66061e68759984eb1cd1db7c685979..f50fcc01ee0b083b8e44398682ef372d80caff21 100644 (file)
@@ -1,4 +1,3 @@
-/* crypto/dsa/dsa_depr.c */
 /* ====================================================================
  * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
  *
  * version(s).
  */
 
-#undef GENUINE_DSA
-
-#ifdef GENUINE_DSA
-/*
- * Parameter generation follows the original release of FIPS PUB 186,
- * Appendix 2.2 (i.e. use SHA as defined in FIPS PUB 180)
- */
-# define HASH    EVP_sha()
-#else
 /*
  * Parameter generation follows the updated Appendix 2.2 for FIPS PUB 186,
  * also Appendix 2.2 of FIPS PUB 186-1 (i.e. use SHA as defined in FIPS PUB
  * 180-1)
  */
-# define HASH    EVP_sha1()
-#endif
+#define xxxHASH    EVP_sha1()
 
-static void *dummy = &dummy;
-
-#ifndef OPENSSL_NO_SHA
+#include <openssl/opensslconf.h>
+#if OPENSSL_API_COMPAT >= 0x00908000L
+NON_EMPTY_TRANSLATION_UNIT
+#else
 
 # include <stdio.h>
 # include <time.h>
-# include "cryptlib.h"
+# include "internal/cryptlib.h"
 # include <openssl/evp.h>
 # include <openssl/bn.h>
 # include <openssl/dsa.h>
 # include <openssl/rand.h>
 # include <openssl/sha.h>
 
-# ifndef OPENSSL_NO_DEPRECATED
 DSA *DSA_generate_parameters(int bits,
                              unsigned char *seed_in, int seed_len,
                              int *counter_ret, unsigned long *h_ret,
@@ -101,10 +90,8 @@ DSA *DSA_generate_parameters(int bits,
     if ((ret = DSA_new()) == NULL)
         return NULL;
     cb = BN_GENCB_new();
-    if (!cb) {
-        DSA_free(ret);
-        return NULL;
-    }
+    if (cb == NULL)
+        goto err;
 
     BN_GENCB_set_old(cb, callback, cb_arg);
 
@@ -114,8 +101,8 @@ DSA *DSA_generate_parameters(int bits,
         return ret;
     }
     BN_GENCB_free(cb);
+err:
     DSA_free(ret);
     return NULL;
 }
-# endif
 #endif