Merge pull request #2222 from solardiz/nexus-wallet

Add Nexus legacy wallet support to -m 11300
This commit is contained in:
Jens Steube
2019-11-15 12:43:50 +01:00
committed by GitHub
2 changed files with 31 additions and 24 deletions

View File

@@ -127,12 +127,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
token.sep[1] = '$';
token.len_min[1] = 2;
token.len_max[1] = 2;
token.len_max[1] = 3;
token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH
| TOKEN_ATTR_VERIFY_DIGIT;
token.sep[2] = '$';
token.len_min[2] = 16;
token.len_min[2] = 64;
token.len_max[2] = 256;
token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH
| TOKEN_ATTR_VERIFY_HEX;
@@ -145,7 +145,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
token.sep[4] = '$';
token.len_min[4] = 16;
token.len_max[4] = 16;
token.len_max[4] = 36;
token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH
| TOKEN_ATTR_VERIFY_HEX;
@@ -208,7 +208,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
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);
if (cry_master_len < 64) return (PARSER_SALT_VALUE);
if (cry_master_len % 32) return (PARSER_SALT_VALUE);
if (cry_salt_len != 16 && cry_salt_len != 36) return (PARSER_SALT_VALUE);
// esalt
@@ -234,7 +237,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt
const bool parse_rc = generic_salt_decode (hashconfig, cry_salt_buf_pos, cry_salt_buf_len, (u8 *) salt->salt_buf, (int *) &salt->salt_len);
const bool parse_rc = generic_salt_decode (hashconfig, cry_salt_buf_pos, 16 /* instead of cry_salt_buf_len */, (u8 *) salt->salt_buf, (int *) &salt->salt_len);
salt->salt_len = cry_salt_buf_len / 2; /* communicate original salt size to the kernel */
if (parse_rc == false) return (PARSER_SALT_LENGTH);