Skip to content

Commit be9ba04

Browse files
committed
Merge branch 'bump-multisig-accounts-limit'
2 parents 2d5b1cb + 2f8e390 commit be9ba04

File tree

3 files changed

+12
-30
lines changed

3 files changed

+12
-30
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Add securechip_model to DeviceInfo: ATECCC608A or ATECC608B.
66
- Added reboot purpose for clearer UX: "Proceed to upgrade?" vs. "Go to startup settings?"
77
- Allow creation of 128 bit seeds (12 BIP39 recovery words)
8+
- Increase maximum number of registered multisig accounts from 10 to 25.
89

910
## 9.5.0 [released 2021-03-10]
1011
- RestoreFrommnemonic: ported to Rust. Will now return UserAbortError on user abort instead of GenericError.

src/memory/memory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#define MEMORY_MULTISIG_NAME_MAX_LEN (31)
2828

2929
// How many multisig configurations (accounts) can be registered.
30-
#define MEMORY_MULTISIG_NUM_ENTRIES 10
30+
#define MEMORY_MULTISIG_NUM_ENTRIES 25
3131

3232
typedef struct {
3333
void (*const random_32_bytes)(uint8_t* buf_out);

test/unit-test/test_memory_functional.c

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -104,38 +104,19 @@ static void _test_memory_multisig_invalid(void** state)
104104
static void _test_memory_multisig_full(void** state)
105105
{
106106
_reset_memory();
107-
const uint8_t hashes[][32] = {
108-
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
109-
"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
110-
"cccccccccccccccccccccccccccccccc",
111-
"dddddddddddddddddddddddddddddddd",
112-
"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
113-
"ffffffffffffffffffffffffffffffff",
114-
"gggggggggggggggggggggggggggggggg",
115-
"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
116-
"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii",
117-
"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj",
118-
"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk",
119-
};
120-
const char* names[] = {
121-
"name1",
122-
"name2",
123-
"name3",
124-
"name4",
125-
"name5",
126-
"name6",
127-
"name7",
128-
"name8",
129-
"name9",
130-
"name10",
131-
"name11",
132-
};
107+
// Only 25 slots available.
108+
const size_t limit = 25;
109+
uint8_t hashes[limit + 1][32];
110+
char names[limit + 1][10];
111+
for (size_t i = 0; i < limit + 1; i++) {
112+
memset(hashes[i], i + i, 32);
113+
snprintf(names[i], sizeof(names[i]), "name%ld", i);
114+
}
133115

134-
// Only 5 slots available.
135-
for (int i = 0; i < 10; i++) {
116+
for (size_t i = 0; i < limit; i++) {
136117
assert_int_equal(MEMORY_OK, memory_multisig_set_by_hash(hashes[i], names[i]));
137118
}
138-
assert_int_equal(MEMORY_ERR_FULL, memory_multisig_set_by_hash(hashes[10], names[10]));
119+
assert_int_equal(MEMORY_ERR_FULL, memory_multisig_set_by_hash(hashes[limit], names[limit]));
139120
}
140121

141122
int main(void)

0 commit comments

Comments
 (0)