From ce9b56e06cd9f9be641ae49ce4b801c8d7521468 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Tue, 14 Aug 2018 15:39:39 +0200 Subject: [PATCH] Allow bitcoin master key length not be exactly 96 byte a multiple of 16 --- docs/changes.txt | 1 + src/interface.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 8e07e1218..97b5e9247 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -5,6 +5,7 @@ ## - Workaround some AMD OpenCL runtime segmentation faults +- Allow bitcoin master key length not be exactly 96 byte a multiple of 16 ## ## Bugs diff --git a/src/interface.c b/src/interface.c index 4d1e68876..0330ede6c 100644 --- a/src/interface.c +++ b/src/interface.c @@ -12401,8 +12401,8 @@ int bitcoin_wallet_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, M | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 96; - token.len_max[2] = 96; + token.len_min[2] = 16; + token.len_max[2] = 256; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; @@ -12479,6 +12479,8 @@ int bitcoin_wallet_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, M if (ckey_buf_len != ckey_len) return (PARSER_SALT_VALUE); if (public_key_buf_len != public_key_len) return (PARSER_SALT_VALUE); + if (cry_master_len % 16) return (PARSER_SALT_VALUE); + // esalt for (int i = 0, j = 0; j < cry_master_len; i += 1, j += 8)