gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r10526 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r10526 - gnunet/src/util
Date: Tue, 9 Mar 2010 18:25:38 +0100

Author: grothoff
Date: 2010-03-09 18:25:38 +0100 (Tue, 09 Mar 2010)
New Revision: 10526

Modified:
   gnunet/src/util/crypto_rsa.c
   gnunet/src/util/disk.c
Log:
OR

Modified: gnunet/src/util/crypto_rsa.c
===================================================================
--- gnunet/src/util/crypto_rsa.c        2010-03-09 16:26:52 UTC (rev 10525)
+++ gnunet/src/util/crypto_rsa.c        2010-03-09 17:25:38 UTC (rev 10526)
@@ -566,6 +566,8 @@
   unsigned int cnt;
   int ec;
   uint64_t fs;
+  struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pub;
+  struct GNUNET_PeerIdentity pid;
 
   if (GNUNET_SYSERR == GNUNET_DISK_directory_create_for_file (filename))
     return NULL;
@@ -622,8 +624,12 @@
         GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "fcntl",
                                   filename);
       GNUNET_assert (GNUNET_YES == GNUNET_DISK_file_close (fd));
+      GNUNET_CRYPTO_rsa_key_get_public (ret, &pub);
+      GNUNET_CRYPTO_hash (&pub, sizeof (pub), &pid.hashPubKey);
       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                  _("Stored new private key in `%s'.\n"), filename);
+                  _("I am host `%s'.  Stored new private key in `%s'.\n"), 
+                 GNUNET_i2s (&pid),
+                 filename);
       return ret;
     }
   /* hostkey file exists already, read it! */
@@ -716,6 +722,12 @@
                                sizeof (struct RsaPrivateKeyBinaryEncoded)))
     GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "fcntl", filename);
   GNUNET_assert (GNUNET_YES == GNUNET_DISK_file_close (fd));
+  GNUNET_CRYPTO_rsa_key_get_public (ret, &pub);
+  GNUNET_CRYPTO_hash (&pub, sizeof (pub), &pid.hashPubKey);
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+             _("I am host `%s'.  Read private key from `%s'.\n"), 
+             GNUNET_i2s (&pid),
+             filename);
   return ret;
 }
 

Modified: gnunet/src/util/disk.c
===================================================================
--- gnunet/src/util/disk.c      2010-03-09 16:26:52 UTC (rev 10525)
+++ gnunet/src/util/disk.c      2010-03-09 17:25:38 UTC (rev 10526)
@@ -1208,7 +1208,7 @@
       return NULL;
     }
   if (flags & GNUNET_DISK_OPEN_FAILIFEXISTS)
-    oflags |= (O_CREAT & O_EXCL);
+    oflags |= (O_CREAT | O_EXCL);
   if (flags & GNUNET_DISK_OPEN_TRUNCATE)
     oflags |= O_TRUNC;
   if (flags & GNUNET_DISK_OPEN_APPEND)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]