aboutsummaryrefslogtreecommitdiff
path: root/src/util/crypto_hash.c
diff options
context:
space:
mode:
authorschanzen <schanzen@140774ce-b5e7-0310-ab8b-a85725594a96>2012-03-26 12:32:40 +0000
committerschanzen <schanzen@140774ce-b5e7-0310-ab8b-a85725594a96>2012-03-26 12:32:40 +0000
commit5a20492845d00aa8f9895e04f980edb9f02e3d51 (patch)
tree2064564e6c80408fe457037d26dc6417523cdb3b /src/util/crypto_hash.c
parent78713a15865b17783c1fce03449960a2d9d74e24 (diff)
-utf8 tolower/upper
git-svn-id: https://gnunet.org/svn/gnunet@20766 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/util/crypto_hash.c')
-rw-r--r--src/util/crypto_hash.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c
index 259f62eb81..4d957c00e7 100644
--- a/src/util/crypto_hash.c
+++ b/src/util/crypto_hash.c
@@ -298,7 +298,12 @@ int
GNUNET_CRYPTO_hash_from_string2 (const char *enc, size_t enclen,
GNUNET_HashCode * result)
{
- return GNUNET_STRINGS_string_to_data (enc, enclen,
+ char upper_enc[enclen];
+ char* up_ptr = upper_enc;
+
+ GNUNET_STRINGS_utf8_toupper(enc, &up_ptr);
+
+ return GNUNET_STRINGS_string_to_data (upper_enc, enclen,
(unsigned char*) result,
sizeof (struct GNUNET_HashCode));
}
@@ -642,7 +647,12 @@ int
GNUNET_CRYPTO_short_hash_from_string2 (const char *enc, size_t enclen,
struct GNUNET_CRYPTO_ShortHashCode * result)
{
- return GNUNET_STRINGS_string_to_data (enc, enclen,
+
+ char upper_enc[enclen];
+ char* up_ptr = upper_enc;
+
+ GNUNET_STRINGS_utf8_toupper(enc, &up_ptr);
+ return GNUNET_STRINGS_string_to_data (upper_enc, enclen,
(unsigned char*) result,
sizeof (struct GNUNET_CRYPTO_ShortHashCode));
}