Make DSA_METHOD opaque
[openssl.git] / apps / srp.c
index 24fb79887ef4be6ec7a93843303dd314b3b2b217..2c4d746f88e56a4251398ebac4c782dafa0281e2 100644 (file)
  * Hudson (tjh@cryptsoft.com).
  *
  */
+
 #include <openssl/opensslconf.h>
+#ifdef OPENSSL_NO_SRP
+NON_EMPTY_TRANSLATION_UNIT
+#else
 
-#ifndef OPENSSL_NO_SRP
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <openssl/conf.h>
-#include <openssl/bio.h>
-#include <openssl/err.h>
-#include <openssl/txt_db.h>
-#include <openssl/buffer.h>
-#include <openssl/srp.h>
-#include "apps.h"
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+# include <openssl/conf.h>
+# include <openssl/bio.h>
+# include <openssl/err.h>
+# include <openssl/txt_db.h>
+# include <openssl/buffer.h>
+# include <openssl/srp.h>
+# include "apps.h"
 
 # define BASE_SECTION    "srp"
 # define CONFIG_FILE "openssl.cnf"
@@ -365,7 +368,7 @@ int srp_main(int argc, char **argv)
             if (verbose)
                 BIO_printf(bio_err,
                            "trying to read " ENV_DEFAULT_SRP
-                           " in \" BASE_SECTION \"\n");
+                           " in " BASE_SECTION "\n");
 
             section = NCONF_get_string(conf, BASE_SECTION, ENV_DEFAULT_SRP);
             if (section == NULL) {
@@ -486,9 +489,9 @@ int srp_main(int argc, char **argv)
                     errors++;
                     goto end;
                 }
-                row[DB_srpid] = BUF_strdup(user);
-                row[DB_srptype] = BUF_strdup("v");
-                row[DB_srpgN] = BUF_strdup(gNid);
+                row[DB_srpid] = OPENSSL_strdup(user);
+                row[DB_srptype] = OPENSSL_strdup("v");
+                row[DB_srpgN] = OPENSSL_strdup(gNid);
 
                 if ((row[DB_srpid] == NULL)
                     || (row[DB_srpgN] == NULL)
@@ -496,7 +499,7 @@ int srp_main(int argc, char **argv)
                     || (row[DB_srpverifier] == NULL)
                     || (row[DB_srpsalt] == NULL)
                     || (userinfo
-                        && ((row[DB_srpinfo] = BUF_strdup(userinfo)) == NULL))
+                        && ((row[DB_srpinfo] = OPENSSL_strdup(userinfo)) == NULL))
                     || !update_index(db, row)) {
                     OPENSSL_free(row[DB_srpid]);
                     OPENSSL_free(row[DB_srpgN]);
@@ -571,7 +574,7 @@ int srp_main(int argc, char **argv)
                     }
 
                     row[DB_srptype][0] = 'v';
-                    row[DB_srpgN] = BUF_strdup(gNid);
+                    row[DB_srpgN] = OPENSSL_strdup(gNid);
 
                     if (row[DB_srpid] == NULL
                         || row[DB_srpgN] == NULL
@@ -579,7 +582,7 @@ int srp_main(int argc, char **argv)
                         || row[DB_srpverifier] == NULL
                         || row[DB_srpsalt] == NULL
                         || (userinfo
-                            && ((row[DB_srpinfo] = BUF_strdup(userinfo))
+                            && ((row[DB_srpinfo] = OPENSSL_strdup(userinfo))
                                 == NULL)))
                         goto end;
 
@@ -653,11 +656,4 @@ int srp_main(int argc, char **argv)
     OBJ_cleanup();
     return (ret);
 }
-
-#else
-
-# if PEDANTIC
-static void *dummy = &dummy;
-# endif
-
 #endif