aboutsummaryrefslogtreecommitdiff
path: root/src/util/common_logging.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/common_logging.c')
-rw-r--r--src/util/common_logging.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index 0c9973d44..6493aae38 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -25,7 +25,6 @@
25 * @author Christian Grothoff 25 * @author Christian Grothoff
26 */ 26 */
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_common.h"
29#include "gnunet_util_lib.h" 28#include "gnunet_util_lib.h"
30#include <regex.h> 29#include <regex.h>
31 30
@@ -1082,16 +1081,19 @@ GNUNET_h2s_full (const struct GNUNET_HashCode * hc)
1082 * 1081 *
1083 * @param pid the peer identity 1082 * @param pid the peer identity
1084 * @return string form of the pid; will be overwritten by next 1083 * @return string form of the pid; will be overwritten by next
1085 * call to GNUNET_i2s. 1084 * call to #GNUNET_i2s.
1086 */ 1085 */
1087const char * 1086const char *
1088GNUNET_i2s (const struct GNUNET_PeerIdentity *pid) 1087GNUNET_i2s (const struct GNUNET_PeerIdentity *pid)
1089{ 1088{
1090 static struct GNUNET_CRYPTO_HashAsciiEncoded ret; 1089 static char buf[256];
1091 1090 char *ret;
1092 GNUNET_CRYPTO_hash_to_enc (&pid->hashPubKey, &ret); 1091
1093 ret.encoding[4] = '\0'; 1092 ret = GNUNET_CRYPTO_ecc_public_sign_key_to_string (&pid->public_key);
1094 return (const char *) ret.encoding; 1093 strcpy (buf, ret);
1094 GNUNET_free (ret);
1095 buf[4] = '\0';
1096 return buf;
1095} 1097}
1096 1098
1097 1099
@@ -1102,15 +1104,18 @@ GNUNET_i2s (const struct GNUNET_PeerIdentity *pid)
1102 * 1104 *
1103 * @param pid the peer identity 1105 * @param pid the peer identity
1104 * @return string form of the pid; will be overwritten by next 1106 * @return string form of the pid; will be overwritten by next
1105 * call to GNUNET_i2s. 1107 * call to #GNUNET_i2s_full.
1106 */ 1108 */
1107const char * 1109const char *
1108GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid) 1110GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid)
1109{ 1111{
1110 static struct GNUNET_CRYPTO_HashAsciiEncoded ret; 1112 static char buf[256];
1113 char *ret;
1111 1114
1112 GNUNET_CRYPTO_hash_to_enc (&pid->hashPubKey, &ret); 1115 ret = GNUNET_CRYPTO_ecc_public_sign_key_to_string (&pid->public_key);
1113 return (const char *) ret.encoding; 1116 strcpy (buf, ret);
1117 GNUNET_free (ret);
1118 return buf;
1114} 1119}
1115 1120
1116 1121