summaryrefslogtreecommitdiff
path: root/lib/str.h
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2016-11-20 17:03:02 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2016-11-20 19:23:42 +0100
commit48bf033618f81c2b8ad41485c471669e9446c06a (patch)
treec1024e60be44bf81a46665726e973633110db12a /lib/str.h
parentf0a1af21552e9ba6e6bf6ce54edb3d464258791f (diff)
downloadgnutls-48bf033618f81c2b8ad41485c471669e9446c06a.tar.gz
tolerate non-valid UTF8 passwords when decrypting
Diffstat (limited to 'lib/str.h')
-rw-r--r--lib/str.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/str.h b/lib/str.h
index 86a35189a0..54c0652553 100644
--- a/lib/str.h
+++ b/lib/str.h
@@ -36,12 +36,13 @@
# define N_(String) String
#endif
-#define NORM_INTERNAL 1
+#define GNUTLS_UTF8_NORM_INTERNAL (1<<16)
int gnutls_utf8_password_normalize(const uint8_t *password, unsigned password_len,
gnutls_datum_t *out, unsigned flags);
-#define _gnutls_utf8_password_normalize(p, plen, out) \
- gnutls_utf8_password_normalize((unsigned char*)p, plen, out, NORM_INTERNAL)
+#define _gnutls_utf8_password_normalize(p, plen, out, ignore_errs) \
+ gnutls_utf8_password_normalize((unsigned char*)p, plen, out, \
+ ignore_errs?(GNUTLS_UTF8_NORM_INTERNAL|GNUTLS_UTF8_IGNORE_ERRS):GNUTLS_UTF8_NORM_INTERNAL)
void _gnutls_str_cpy(char *dest, size_t dest_tot_size, const char *src);
void _gnutls_mem_cpy(char *dest, size_t dest_tot_size, const char *src,