aboutsummaryrefslogtreecommitdiff
path: root/src/gnsrecord
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-03-03 22:05:37 +0100
committerChristian Grothoff <christian@grothoff.org>2018-03-03 22:05:37 +0100
commit65377c3d9087635696f66b2444ef1d7eb39d4cd0 (patch)
tree14ff5999de78cf717e6e7b4541f469d1b24b243d /src/gnsrecord
parentcd2b8b467b218dfdd2d5124ad2d835161f3a2b1a (diff)
eliminate .gnu from GNS
Diffstat (limited to 'src/gnsrecord')
-rw-r--r--src/gnsrecord/gnsrecord_misc.c31
1 files changed, 7 insertions, 24 deletions
diff --git a/src/gnsrecord/gnsrecord_misc.c b/src/gnsrecord/gnsrecord_misc.c
index 4c3bf6fa8f..3c1ead437c 100644
--- a/src/gnsrecord/gnsrecord_misc.c
+++ b/src/gnsrecord/gnsrecord_misc.c
@@ -241,7 +241,7 @@ GNUNET_GNSRECORD_pkey_to_zkey (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey)
pkeys = GNUNET_CRYPTO_ecdsa_public_key_to_string (pkey);
GNUNET_snprintf (ret,
sizeof (ret),
- "%s.zkey",
+ "%s",
pkeys);
GNUNET_free (pkeys);
return ret;
@@ -249,10 +249,10 @@ GNUNET_GNSRECORD_pkey_to_zkey (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey)
/**
- * Convert an absolute domain name in the ".zkey" pTLD to the
+ * Convert an absolute domain name to the
* respective public key.
*
- * @param zkey string "X.zkey" where X is the coordinates of the public
+ * @param zkey string encoding the coordinates of the public
* key in an encoding suitable for DNS labels.
* @param pkey set to a public key on the eliptic curve
* @return #GNUNET_SYSERR if @a zkey has the wrong syntax
@@ -261,29 +261,12 @@ int
GNUNET_GNSRECORD_zkey_to_pkey (const char *zkey,
struct GNUNET_CRYPTO_EcdsaPublicKey *pkey)
{
- char *cpy;
- char *dot;
- const char *x;
-
- cpy = GNUNET_strdup (zkey);
- x = cpy;
- if (NULL == (dot = strchr (x, (int) '.')))
- goto error;
- *dot = '\0';
- if (0 != strcasecmp (dot + 1,
- "zkey"))
- goto error;
-
if (GNUNET_OK !=
- GNUNET_CRYPTO_ecdsa_public_key_from_string (x,
- strlen (x),
- pkey))
- goto error;
- GNUNET_free (cpy);
+ GNUNET_CRYPTO_ecdsa_public_key_from_string (zkey,
+ strlen (zkey),
+ pkey))
+ return GNUNET_SYSERR;
return GNUNET_OK;
- error:
- GNUNET_free (cpy);
- return GNUNET_SYSERR;
}