Compare commits

...

11 Commits

6 changed files with 36 additions and 19 deletions

View File

@ -197,6 +197,16 @@
"code", "code",
"doc" "doc"
] ]
},
{
"login": "ccinelli",
"name": "ccinelli",
"avatar_url": "https://avatars0.githubusercontent.com/u/38021940?v=4",
"profile": "https://github.com/ccinelli",
"contributions": [
"infra",
"test"
]
} }
], ],
"contributorsPerLine": 7, "contributorsPerLine": 7,

View File

@ -166,6 +166,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="http://www.schulz.dk"><img src="https://avatars1.githubusercontent.com/u/1150049?v=4" width="100px;" alt="Kim Schulz"/><br /><sub><b>Kim Schulz</b></sub></a><br /><a href="#business-kimusan" title="Business development">💼</a> <a href="#ideas-kimusan" title="Ideas, Planning, & Feedback">🤔</a></td> <td align="center"><a href="http://www.schulz.dk"><img src="https://avatars1.githubusercontent.com/u/1150049?v=4" width="100px;" alt="Kim Schulz"/><br /><sub><b>Kim Schulz</b></sub></a><br /><a href="#business-kimusan" title="Business development">💼</a> <a href="#ideas-kimusan" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://github.com/oplik0"><img src="https://avatars2.githubusercontent.com/u/25460763?v=4" width="100px;" alt="Jakub"/><br /><sub><b>Jakub</b></sub></a><br /><a href="https://github.com/solokeys/solo/issues?q=author%3Aoplik0" title="Bug reports">🐛</a></td> <td align="center"><a href="https://github.com/oplik0"><img src="https://avatars2.githubusercontent.com/u/25460763?v=4" width="100px;" alt="Jakub"/><br /><sub><b>Jakub</b></sub></a><br /><a href="https://github.com/solokeys/solo/issues?q=author%3Aoplik0" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/jolo1581"><img src="https://avatars1.githubusercontent.com/u/53423977?v=4" width="100px;" alt="Jan A."/><br /><sub><b>Jan A.</b></sub></a><br /><a href="https://github.com/solokeys/solo/commits?author=jolo1581" title="Code">💻</a> <a href="https://github.com/solokeys/solo/commits?author=jolo1581" title="Documentation">📖</a></td> <td align="center"><a href="https://github.com/jolo1581"><img src="https://avatars1.githubusercontent.com/u/53423977?v=4" width="100px;" alt="Jan A."/><br /><sub><b>Jan A.</b></sub></a><br /><a href="https://github.com/solokeys/solo/commits?author=jolo1581" title="Code">💻</a> <a href="https://github.com/solokeys/solo/commits?author=jolo1581" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/ccinelli"><img src="https://avatars0.githubusercontent.com/u/38021940?v=4" width="100px;" alt="ccinelli"/><br /><sub><b>ccinelli</b></sub></a><br /><a href="#infra-ccinelli" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/solokeys/solo/commits?author=ccinelli" title="Tests">⚠️</a></td>
</tr> </tr>
</table> </table>
@ -199,7 +200,7 @@ You can buy Solo, Solo Tap, and Solo for Hackers at [solokeys.com](https://solok
<br/> <br/>
[![License](https://img.shields.io/github/license/solokeys/solo.svg)](https://github.com/solokeys/solo/blob/master/LICENSE) [![License](https://img.shields.io/github/license/solokeys/solo.svg)](https://github.com/solokeys/solo/blob/master/LICENSE)
[![All Contributors](https://img.shields.io/badge/all_contributors-20-orange.svg?style=flat-square)](#contributors) [![All Contributors](https://img.shields.io/badge/all_contributors-21-orange.svg?style=flat-square)](#contributors)
[![Build Status](https://travis-ci.com/solokeys/solo.svg?branch=master)](https://travis-ci.com/solokeys/solo) [![Build Status](https://travis-ci.com/solokeys/solo.svg?branch=master)](https://travis-ci.com/solokeys/solo)
[![Discourse Users](https://img.shields.io/discourse/https/discourse.solokeys.com/users.svg)](https://discourse.solokeys.com) [![Discourse Users](https://img.shields.io/discourse/https/discourse.solokeys.com/users.svg)](https://discourse.solokeys.com)
[![Keybase Chat](https://img.shields.io/badge/chat-on%20keybase-brightgreen.svg)](https://keybase.io/team/solokeys.public) [![Keybase Chat](https://img.shields.io/badge/chat-on%20keybase-brightgreen.svg)](https://keybase.io/team/solokeys.public)

View File

@ -1 +1 @@
2.5.3 3.0.0

View File

@ -760,30 +760,37 @@ uint8_t ctaphid_custom_command(int len, CTAP_RESPONSE * ctap_resp, CTAPHID_WRITE
case CTAPHID_LOADKEY: case CTAPHID_LOADKEY:
/** /**
* Load external key. Useful for enabling backups. * Load external key. Useful for enabling backups.
* bytes: 4 96 * bytes: 4 4 96
* payload: | counter_increase (BE) | master_key | * payload: version [maj rev patch RFU]| counter_replacement (BE) | master_key |
* *
* Counter should be increased by a large amount, e.g. (0x10000000) * Counter should be increased by a large amount, e.g. (0x10000000)
* to outdo any previously lost/broken keys. * to outdo any previously lost/broken keys.
*/ */
printf1(TAG_HID,"CTAPHID_LOADKEY\n"); printf1(TAG_HID,"CTAPHID_LOADKEY\n");
if (len != 100) if (len != 104)
{ {
printf2(TAG_ERR,"Error, invalid length.\n"); printf2(TAG_ERR,"Error, invalid length.\n");
ctaphid_send_error(wb->cid, CTAP1_ERR_INVALID_LENGTH); ctaphid_send_error(wb->cid, CTAP1_ERR_INVALID_LENGTH);
return 1; return 1;
} }
param = ctap_buffer[0] << 16;
param |= ctap_buffer[1] << 8;
param |= ctap_buffer[2] << 0;
if (param != 0){
ctaphid_send_error(wb->cid, CTAP2_ERR_UNSUPPORTED_OPTION);
return 1;
}
// Ask for THREE button presses // Ask for THREE button presses
if (ctap_user_presence_test(8000) > 0) if (ctap_user_presence_test(8000) > 0)
if (ctap_user_presence_test(8000) > 0) if (ctap_user_presence_test(2000) > 0)
if (ctap_user_presence_test(8000) > 0) if (ctap_user_presence_test(2000) > 0)
{ {
ctap_load_external_keys(ctap_buffer + 4); ctap_load_external_keys(ctap_buffer + 8);
param = ctap_buffer[3]; param = ctap_buffer[7];
param |= ctap_buffer[2] << 8; param |= ctap_buffer[6] << 8;
param |= ctap_buffer[1] << 16; param |= ctap_buffer[5] << 16;
param |= ctap_buffer[0] << 24; param |= ctap_buffer[4] << 24;
ctap_atomic_count(param); ctap_atomic_count(param);
wb->bcnt = 0; wb->bcnt = 0;

View File

@ -46,9 +46,7 @@ int main()
{ {
uint8_t hidmsg[64]; uint8_t hidmsg[64];
uint32_t t1 = 0; uint32_t t1 = 0;
#ifdef SOLO_HACKER
uint32_t stboot_time = 0; uint32_t stboot_time = 0;
#endif
uint32_t boot = 1; uint32_t boot = 1;
set_logging_mask( set_logging_mask(
@ -98,7 +96,6 @@ int main()
} }
#ifdef SOLO_HACKER
if (!is_bootloader_disabled()) if (!is_bootloader_disabled())
{ {
stboot_time = millis(); stboot_time = millis();
@ -108,7 +105,6 @@ int main()
goto start_bootloader; goto start_bootloader;
} }
} }
#endif
if (is_authorized_to_boot() && (boot || is_bootloader_disabled())) if (is_authorized_to_boot() && (boot || is_bootloader_disabled()))
{ {
@ -119,9 +115,8 @@ int main()
printf1(TAG_RED,"Not authorized to boot (%08x == %08lx)\r\n", AUTH_WORD_ADDR, *(uint32_t*)AUTH_WORD_ADDR); printf1(TAG_RED,"Not authorized to boot (%08x == %08lx)\r\n", AUTH_WORD_ADDR, *(uint32_t*)AUTH_WORD_ADDR);
} }
#ifdef SOLO_HACKER
start_bootloader: start_bootloader:
#endif
SystemClock_Config(); SystemClock_Config();
init_gpio(); init_gpio();
init_millisecond_timer(0); init_millisecond_timer(0);

View File

@ -560,7 +560,11 @@ uint32_t ctap_atomic_count(uint32_t amount)
return lastc; return lastc;
} }
lastc += amount; if (amount > 256){
lastc = amount;
} else {
lastc += amount;
}
if (lastc/256 > erases) if (lastc/256 > erases)
{ {