diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2016-11-20 17:03:02 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2016-11-20 19:23:42 +0100 |
commit | 48bf033618f81c2b8ad41485c471669e9446c06a (patch) | |
tree | c1024e60be44bf81a46665726e973633110db12a /lib/str.h | |
parent | f0a1af21552e9ba6e6bf6ce54edb3d464258791f (diff) | |
download | gnutls-48bf033618f81c2b8ad41485c471669e9446c06a.tar.gz |
tolerate non-valid UTF8 passwords when decrypting
Diffstat (limited to 'lib/str.h')
-rw-r--r-- | lib/str.h | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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, |