Compare commits
14 Commits
cbor_safet
...
fix_versio
Author | SHA1 | Date | |
---|---|---|---|
a17637deb4 | |||
8ed7157bfe | |||
28a1b1cc06 | |||
5738bcc7a3 | |||
4fb166631d | |||
1b862d3b0c | |||
094420b32b | |||
349cbc39f2 | |||
e294cb3458 | |||
da31f984dd | |||
9d3e8c06fc | |||
b378bbf61d | |||
04b89a9739 | |||
0d28a7bcf6 |
@ -1 +1 @@
|
|||||||
3.1.1
|
3.1.2
|
||||||
|
@ -104,9 +104,24 @@ solo mergehex bootloader.hex solo.hex bundle.hex
|
|||||||
|
|
||||||
`bundle.hex` is our complete firmware build. Note it is in this step that you can
|
`bundle.hex` is our complete firmware build. Note it is in this step that you can
|
||||||
include a custom attestation certificate or lock the device from debugging/DFU.
|
include a custom attestation certificate or lock the device from debugging/DFU.
|
||||||
By default the "hacker" attestation certifcate and key is used.
|
By default the "hacker" attestation certifcate and key is used. Use the `--lock` flag
|
||||||
|
to make this permanent.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
solo mergehex \
|
||||||
|
--attestation-key "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF" \
|
||||||
|
--attestation-cert attestation.der \
|
||||||
|
solo.hex \
|
||||||
|
bootloader.hex \
|
||||||
|
bundle.hex
|
||||||
|
```
|
||||||
|
|
||||||
|
**Warning**: If you use `--lock`, this will permanently lock the device to this new bootloader. You
|
||||||
|
won't be able to program the bootloader again or be able to connect a hardware debugger.
|
||||||
|
The new bootloader may be able to accept (signed) updates still, depending on how you configured it.
|
||||||
|
|
||||||
|
```
|
||||||
|
# Permanent!
|
||||||
solo mergehex \
|
solo mergehex \
|
||||||
--attestation-key "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF" \
|
--attestation-key "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF" \
|
||||||
--attestation-cert attestation.der \
|
--attestation-cert attestation.der \
|
||||||
@ -118,9 +133,5 @@ solo mergehex \
|
|||||||
|
|
||||||
See [here for more information on custom attestation](/solo/customization/).
|
See [here for more information on custom attestation](/solo/customization/).
|
||||||
|
|
||||||
If you use `--lock`, this will permanently lock the device to this new bootloader. You
|
|
||||||
won't be able to program the bootloader again or be able to connect a hardware debugger.
|
|
||||||
The new bootloader may be able to accept (signed) updates still, depending on how you configured it.
|
|
||||||
|
|
||||||
To learn more about normal updates or a "full" update, you should [read more on Solo's boot stages](/solo/bootloader-mode).
|
To learn more about normal updates or a "full" update, you should [read more on Solo's boot stages](/solo/bootloader-mode).
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ Note you must use a prime256v1 curve for this step, and you must leave the unit/
|
|||||||
country=US
|
country=US
|
||||||
state=Maine
|
state=Maine
|
||||||
organization=OpenSourceSecurity
|
organization=OpenSourceSecurity
|
||||||
unit="Authenticator Attestation"
|
unit="Authenticator Attestation" # MUST KEEP THIS AS "Authenticator Attestation" for FIDO2.
|
||||||
CN=example.com
|
CN=example.com
|
||||||
email=example@example.com
|
email=example@example.com
|
||||||
|
|
||||||
@ -134,6 +134,8 @@ solo mergehex \
|
|||||||
bundle.hex
|
bundle.hex
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Warning**: Using the `--lock` flag prevents the DFU from being accessed on the device again. It's recommended to try first without the `--lock` flag to make sure it works.
|
||||||
|
|
||||||
Now you have a newly created `bundle.hex` file with a custom attestation key and cert. You can [program this `bundle.hex` file
|
Now you have a newly created `bundle.hex` file with a custom attestation key and cert. You can [program this `bundle.hex` file
|
||||||
with Solo in DFU mode](/solo/programming#procedure).
|
with Solo in DFU mode](/solo/programming#procedure).
|
||||||
|
|
||||||
|
@ -666,8 +666,8 @@ uint8_t ctap_parse_extensions(CborValue * val, CTAP_extensions * ext)
|
|||||||
if (ret == CborErrorOutOfMemory)
|
if (ret == CborErrorOutOfMemory)
|
||||||
{
|
{
|
||||||
printf2(TAG_ERR,"Error, rp map key is too large. Ignoring.\n");
|
printf2(TAG_ERR,"Error, rp map key is too large. Ignoring.\n");
|
||||||
cbor_value_advance(&map);
|
check_ret( cbor_value_advance(&map) );
|
||||||
cbor_value_advance(&map);
|
check_ret( cbor_value_advance(&map) );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
check_ret(ret);
|
check_ret(ret);
|
||||||
@ -1353,11 +1353,21 @@ uint8_t ctap_parse_client_pin(CTAP_clientPin * CP, uint8_t * request, int length
|
|||||||
break;
|
break;
|
||||||
case CP_getKeyAgreement:
|
case CP_getKeyAgreement:
|
||||||
printf1(TAG_CP,"CP_getKeyAgreement\n");
|
printf1(TAG_CP,"CP_getKeyAgreement\n");
|
||||||
|
if (cbor_value_get_type(&map) != CborBooleanType)
|
||||||
|
{
|
||||||
|
printf2(TAG_ERR,"Error, expecting cbor boolean\n");
|
||||||
|
return CTAP2_ERR_INVALID_CBOR_TYPE;
|
||||||
|
}
|
||||||
ret = cbor_value_get_boolean(&map, &CP->getKeyAgreement);
|
ret = cbor_value_get_boolean(&map, &CP->getKeyAgreement);
|
||||||
check_ret(ret);
|
check_ret(ret);
|
||||||
break;
|
break;
|
||||||
case CP_getRetries:
|
case CP_getRetries:
|
||||||
printf1(TAG_CP,"CP_getRetries\n");
|
printf1(TAG_CP,"CP_getRetries\n");
|
||||||
|
if (cbor_value_get_type(&map) != CborBooleanType)
|
||||||
|
{
|
||||||
|
printf2(TAG_ERR,"Error, expecting cbor boolean\n");
|
||||||
|
return CTAP2_ERR_INVALID_CBOR_TYPE;
|
||||||
|
}
|
||||||
ret = cbor_value_get_boolean(&map, &CP->getRetries);
|
ret = cbor_value_get_boolean(&map, &CP->getRetries);
|
||||||
check_ret(ret);
|
check_ret(ret);
|
||||||
break;
|
break;
|
||||||
|
@ -779,30 +779,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;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
#include "app.h"
|
||||||
|
|
||||||
const version_t firmware_version
|
const version_t firmware_version
|
||||||
#ifdef SOLO
|
#ifdef SOLO
|
||||||
|
@ -84,4 +84,5 @@ cbor:
|
|||||||
cd ../../tinycbor/ && make clean
|
cd ../../tinycbor/ && make clean
|
||||||
cd ../../tinycbor/ && make CC="$(CC)" AR=$(AR) \
|
cd ../../tinycbor/ && make CC="$(CC)" AR=$(AR) \
|
||||||
LDFLAGS="$(LDFLAGS_LIB)" \
|
LDFLAGS="$(LDFLAGS_LIB)" \
|
||||||
CFLAGS="$(CFLAGS) -Os"
|
CFLAGS="$(CFLAGS) -Os -DCBOR_PARSER_MAX_RECURSIONS=3"
|
||||||
|
|
||||||
|
@ -577,7 +577,11 @@ uint32_t ctap_atomic_count(uint32_t amount)
|
|||||||
return lastc;
|
return lastc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (amount > 256){
|
||||||
|
lastc = amount;
|
||||||
|
} else {
|
||||||
lastc += amount;
|
lastc += amount;
|
||||||
|
}
|
||||||
|
|
||||||
if (lastc/256 > erases)
|
if (lastc/256 > erases)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user