summaryrefslogtreecommitdiff
path: root/lib/str.h
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-11-10 16:43:23 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-11-11 13:38:37 +0100
commitc2fa842bdcb88d0f7a16be9e49cc87b340cb68e2 (patch)
tree824bfcd9cd5f464699ed2b4983cfded8b726c039 /lib/str.h
parent6d5c80e2bf7efbc4e99588b8d8ec4f383d34375f (diff)
downloadgnutls-tmp-uninorm-everywhere.tar.gz
x509: when writing fields known to be in UTF-8 form convert to NFCtmp-uninorm-everywhere
This ensures that we always write proper UTF-8 data, uniquely encoded.
Diffstat (limited to 'lib/str.h')
-rw-r--r--lib/str.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/str.h b/lib/str.h
index 4e497b630a..780245b733 100644
--- a/lib/str.h
+++ b/lib/str.h
@@ -38,8 +38,10 @@
#if defined(HAVE_LIBUNISTRING)
uint8_t *_gnutls_normalize_u8_password(const uint8_t *password);
+uint8_t *_gnutls_normalize_u8_nfc(const uint8_t *str, size_t str_size);
#else
-# define _gnutls_normalize_u8_password(password) ((uint8_t*)strdup((char*)password))
+# define _gnutls_normalize_u8_password(password) ((uint8_t*)gnutls_strdup((char*)password))
+# define _gnutls_normalize_u8_nfc(str, str_size) ((uint8_t*)gnutls_strdup((char*)str))
#endif
void _gnutls_str_cpy(char *dest, size_t dest_tot_size, const char *src);