]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
avoid using gc_ functions for random data.
authorNikos Mavrogiannopoulos <nmav@crystal.(none)>
Mon, 30 Jun 2008 17:13:24 +0000 (20:13 +0300)
committerNikos Mavrogiannopoulos <nmav@crystal.(none)>
Mon, 30 Jun 2008 17:13:24 +0000 (20:13 +0300)
src/crypt.c
src/psk.c

index 27ac16faa7e965f8eb62922a84eaea59791aa94c..cb982b08fe3cdb98f6f61a408e2b1f8abd06a56e 100644 (file)
@@ -48,8 +48,7 @@ srptool_version (void)
 #include <gnutls/gnutls.h>
 #include <gnutls/extra.h>
 #include <crypt-gaa.h>
-
-#include <gc.h>                        /* for randomize */
+#include "../lib/random.h" /* for random */
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -507,7 +506,7 @@ _srp_crypt (const char *username, const char *passwd, int salt_size,
 
   /* generate the salt
    */
-  if (gc_nonce (salt, salt_size) != GC_OK)
+  if (_gnutls_rnd (RND_NONCE, salt, salt_size) < 0)
     {
       fprintf (stderr, "Could not create nonce\n");
       return NULL;
index d4bc5ea1fec0429355194b6aad146d2a1bdde9a5..5e6376cc56ec50bb587ba6ef52764f0feef4ca72 100644 (file)
--- a/src/psk.c
+++ b/src/psk.c
@@ -48,7 +48,7 @@ psktool_version (void)
 #include <gnutls/extra.h>
 #include <psk-gaa.h>
 
-#include <gc.h>                        /* for randomize */
+#include "../lib/random.h" /* for random */
 #include "getpass.h"
 
 #include <sys/types.h>
@@ -158,8 +158,8 @@ main (int argc, char **argv)
 
       printf ("Generating a random key for user '%s'\n", info.username);
 
-      ret = gc_pseudo_random ((char *) key, info.key_size);
-      if (ret != GC_OK)
+      ret = _gnutls_rnd (RND_RANDOM, (char*)key, info.key_size);
+      if (ret < 0)
        {
          fprintf (stderr, "Not enough randomness\n");
          exit (1);