Update plibc header
[oweals/gnunet.git] / src / util / gnunet-ecc.c
index 9f76d6b8e1d6e2d6559d5316fc158c7694350415..23e562cbee98ad94b87e56264d0450011d48e351 100644 (file)
@@ -66,7 +66,7 @@ create_keys (const char *fn)
           _("Generating %u keys, please wait"),
           make_keys);
   while (0 < make_keys--)
-  {    
+  {
     fprintf (stderr,
             ".");
     if (NULL == (pk = GNUNET_CRYPTO_ecc_key_create ()))
@@ -74,7 +74,7 @@ create_keys (const char *fn)
        GNUNET_break (0);
        break;
     }
-    if (GNUNET_TESTING_HOSTKEYFILESIZE != 
+    if (GNUNET_TESTING_HOSTKEYFILESIZE !=
        fwrite (pk, 1,
                GNUNET_TESTING_HOSTKEYFILESIZE, f))
     {
@@ -111,7 +111,6 @@ run (void *cls, char *const *args, const char *cfgfile,
 {
   struct GNUNET_CRYPTO_EccPrivateKey *pk;
   struct GNUNET_CRYPTO_EccPublicSignKey pub;
-  struct GNUNET_PeerIdentity pid;
 
   if (NULL == args[0])
   {
@@ -137,12 +136,14 @@ run (void *cls, char *const *args, const char *cfgfile,
   }
   if (print_peer_identity)
   {
-    struct GNUNET_CRYPTO_HashAsciiEncoded enc;
+    char *str;
 
     GNUNET_CRYPTO_ecc_key_get_public_for_signature (pk, &pub);
-    GNUNET_CRYPTO_hash (&pub, sizeof (pub), &pid.hashPubKey);
-    GNUNET_CRYPTO_hash_to_enc (&pid.hashPubKey, &enc);
-    fprintf (stdout, "%s\n", enc.encoding);
+    str = GNUNET_CRYPTO_ecc_public_sign_key_to_string (&pub);
+    fprintf (stdout,
+             "%s\n",
+             str);
+    GNUNET_free (str);
   }
   GNUNET_free (pk);
 }