#include "gnunet_common.h"
#include "gnunet_crypto_lib.h"
#include "gnunet_disk_lib.h"
+#include "gnunet_strings_lib.h"
#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
keylen += 5 - keylen % 5;
keylen /= 5;
pubkeybuf = GNUNET_malloc (keylen + 1);
- end = GNUNET_CRYPTO_data_to_string ((unsigned char *) &pub,
- sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
- pubkeybuf,
- keylen);
+ end = GNUNET_STRINGS_data_to_string ((unsigned char *) pub,
+ sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
+ pubkeybuf,
+ keylen);
if (NULL == end)
- {
- GNUNET_free (pubkeybuf);
- return NULL;
- }
+ {
+ GNUNET_free (pubkeybuf);
+ return NULL;
+ }
*end = '\0';
return pubkeybuf;
}
if (enclen != keylen)
return GNUNET_SYSERR;
- if (GNUNET_OK != GNUNET_CRYPTO_string_to_data (enc, enclen,
+ if (GNUNET_OK != GNUNET_STRINGS_string_to_data (enc, enclen,
(unsigned char*) pub,
sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)))
return GNUNET_SYSERR;
pk = GNUNET_CRYPTO_rsa_key_create_from_file (fn);
if (NULL != pk)
GNUNET_CRYPTO_rsa_key_free (pk);
+ GNUNET_free (fn);
}
GNUNET_CONFIGURATION_destroy (cfg);
}