aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authorLRN <lrn1986@gmail.com>2013-03-03 01:57:10 +0000
committerLRN <lrn1986@gmail.com>2013-03-03 01:57:10 +0000
commit058c49560ff702057bd8799c2d21b1fd70cb7134 (patch)
treea4a1d481f45cac006aa452aef2a451f16d03097a /src/fs
parent63346db616d6478416ec5686746a7818acf81ed6 (diff)
downloadgnunet-058c49560ff702057bd8799c2d21b1fd70cb7134.tar.gz
gnunet-058c49560ff702057bd8799c2d21b1fd70cb7134.zip
Implement and use GNUNET_FS_namespace_get_public_key_hash
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/fs_namespace.c19
-rw-r--r--src/fs/fs_uri.c3
2 files changed, 20 insertions, 2 deletions
diff --git a/src/fs/fs_namespace.c b/src/fs/fs_namespace.c
index 9781cf6b7..177af7efc 100644
--- a/src/fs/fs_namespace.c
+++ b/src/fs/fs_namespace.c
@@ -496,6 +496,25 @@ struct ProcessNamespaceContext
496 496
497 497
498/** 498/**
499 * Get hash of the public key of a namespace.
500 *
501 * @param ns namespace
502 * @param id buffer to store the key in
503 * @return GNUNET_OK on success
504 * GNUNET_SYSERR on failure (contents of id remain intact)
505 */
506int
507GNUNET_FS_namespace_get_public_key_hash (struct GNUNET_FS_Namespace *ns,
508 struct GNUNET_HashCode *id)
509{
510 if ((NULL == ns) || (NULL == id))
511 return GNUNET_SYSERR;
512 GNUNET_CRYPTO_rsa_get_public_key_hash (ns->key, id);
513 return GNUNET_OK;
514}
515
516
517/**
499 * Function called with a filename of a namespace. Reads the key and 518 * Function called with a filename of a namespace. Reads the key and
500 * calls the callback. 519 * calls the callback.
501 * 520 *
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c
index d38a5354d..d929eec64 100644
--- a/src/fs/fs_uri.c
+++ b/src/fs/fs_uri.c
@@ -948,8 +948,7 @@ GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns, const char *id,
948 948
949 ns_uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 949 ns_uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
950 ns_uri->type = GNUNET_FS_URI_SKS; 950 ns_uri->type = GNUNET_FS_URI_SKS;
951 GNUNET_CRYPTO_rsa_key_get_public (ns->key, &pk); 951 GNUNET_FS_namespace_get_public_key_hash (ns, &ns_uri->data.sks.ns);
952 GNUNET_CRYPTO_hash (&pk, sizeof (pk), &ns_uri->data.sks.ns);
953 ns_uri->data.sks.identifier = GNUNET_strdup (id); 952 ns_uri->data.sks.identifier = GNUNET_strdup (id);
954 return ns_uri; 953 return ns_uri;
955} 954}