Compare commits

..

7 Commits

15 changed files with 58 additions and 195 deletions

View File

@ -100,10 +100,9 @@ uncached-docker-build-toolchain:
docker tag $(DOCKER_TOOLCHAIN_IMAGE):latest $(DOCKER_TOOLCHAIN_IMAGE):${SOLO_VERSION_MAJ} docker tag $(DOCKER_TOOLCHAIN_IMAGE):latest $(DOCKER_TOOLCHAIN_IMAGE):${SOLO_VERSION_MAJ}
docker tag $(DOCKER_TOOLCHAIN_IMAGE):latest $(DOCKER_TOOLCHAIN_IMAGE):${SOLO_VERSION_MAJ}.${SOLO_VERSION_MIN} docker tag $(DOCKER_TOOLCHAIN_IMAGE):latest $(DOCKER_TOOLCHAIN_IMAGE):${SOLO_VERSION_MAJ}.${SOLO_VERSION_MIN}
docker-build-all: docker-build-all:
docker run --rm -v "$(CURDIR)/builds:/builds" \ docker run --rm -v "$(CURDIR)/builds:/builds" \
-v "$(CURDIR):/solo" \ -v "$(CURDIR):/solo" \
-u $(shell id -u ${USER}):$(shell id -g ${USER}) \
$(DOCKER_TOOLCHAIN_IMAGE) "solo/in-docker-build.sh" ${SOLO_VERSION_FULL} $(DOCKER_TOOLCHAIN_IMAGE) "solo/in-docker-build.sh" ${SOLO_VERSION_FULL}
CPPCHECK_FLAGS=--quiet --error-exitcode=2 CPPCHECK_FLAGS=--quiet --error-exitcode=2

View File

@ -61,11 +61,9 @@ git checkout ${VERSION_TO_BUILD}
git submodule update --init --recursive git submodule update --init --recursive
``` ```
## Installing the toolchain and applying updates ## Installing the toolchain
In order to compile ARM code, you need the ARM compiler and other things like bundling bootloader and firmware require the [solo-python](https://github.com/solokeys/solo-python) python package. Check our [documentation](https://docs.solokeys.io/solo/) for details. In order to compile ARM code, you need the ARM compiler and other things like bundling bootloader and firmware require the `solo-python` python package. Check our [documentation](https://docs.solokeys.io/solo/) for details
You can update your solokey after running `pip3 install solo-python` with `solo key update` for the latest version. To apply a custom image use `solo program bootloader <file>(.json|.hex)`.
## Installing the toolkit and compiling in Docker ## Installing the toolkit and compiling in Docker
Alternatively, you can use Docker to create a container with the toolchain. Alternatively, you can use Docker to create a container with the toolchain.

View File

@ -1 +1 @@
3.1.2 3.0.0

View File

@ -1,23 +1,16 @@
# Using Solo for passwordless or second factor login on Linux # Using Solo for passwordless or second factor login on Linux
## Setup on Ubuntu and Manjaro ## Setup on Ubuntu 18.04
Before you can use Solo for passwordless or second factor login in your Linux system you have to install some packages. Before you can use Solo for passwordless or second factor login in your Linux system you have to install some packages.
This was tested on **Linux Mint 19.3** and on **Manjaro 18.x** This was tested under **Linux Mint 19.2**.
First you have to install PAM modules for u2f. First you have to install PAM modules for u2f.
**Ubuntu (Linux Mint):**
``` ```
sudo apt install libpam-u2f pamu2fcfg sudo apt install libpam-u2f pamu2fcfg
``` ```
**Manjaro**
```
pacman -Syu pam-u2f
```
## Setting up key ## Setting up key
To use Solo as passwordless or second factor login, you have to setup your system with your Solo. To use Solo as passwordless or second factor login, you have to setup your system with your Solo.
First create a new folder named **Yubico** in your **.config** folder in your **home** directory First create a new folder named **Yubico** in your **.config** folder in your **home** directory
@ -35,57 +28,35 @@ If you want to register an additional key use this command instead:
pamu2fcfg >> ~/.config/Yubico/u2f_keys pamu2fcfg >> ~/.config/Yubico/u2f_keys
``` ```
Now press the button on your Solo. Now press the button on your Solo.
<br>
<br>
If you can't generate your key on **Ubuntu** (error message), you may add Yubico Team from PPA and install latest libpam-u2f and pamu2fcfg and try again. If you can't generate your key (error message), you may add Yubico Team from PPA and install latest libpam-u2f and pamu2fcfg and try again.
``` ```
sudo add-apt-repository ppa:yubico/stable sudo add-apt-repository ppa:yubico/stable
sudo apt-get update sudo apt-get update
sudo apt-get upgrade sudo apt-get upgrade
``` ```
**Manjaro** should work without problems.
## Login into Linux ## Login into Linux
### Passwordless ### Passwordless
To login passwordless into your Linux system, you have to edit the file **lightdm** (or **gdm** or which display manager you prefered). To login passwordless into your Linux system, you have to edit the file **lightdm** (or **gdm** or which display manager you prefered).
In case of lightdm and VIM as editor: In case of lightdm:
``` ```
sudo vim /etc/pam.d/lightdm sudo vim /etc/pam.d/lightdm
``` ```
Now search following entry:
**On Ubuntu:**<br>
Search following entry:
``` ```
@include common-auth @include common-auth
``` ```
and add and add
``` ```
auth sufficient pam_u2f.so auth sufficient pam_u2f.so
``` ```
**before** *@include common-auth.* **before** @include common-auth.
<br>
<br>
**On Manjaro**<br> Save the file and test it.<br>
Search following enrty
```
auth include system-login
```
and add
```
auth sufficient pam_u2f.so
```
** before** *auth include system-login*.
<br>
<br>
Now save the file and test it.<br>
Insert Solo in your USB port and logout. Insert Solo in your USB port and logout.
Now you should be able to login into Linux without password, only with pressing your button on Solo and press enter. Now you should be able to login into Linux without password, only with pressing your button on Solo and press enter.
@ -94,7 +65,7 @@ Why **sufficient**? The difference between the keyword sufficient and required i
The login mechanism can be also used for additional features like: The login mechanism can be also used for additional features like:
- Login after screen timeout - edit /etc/pam.d/mate-screensaver (or kde-screensaver, ...) : - Login after screen timeout - edit /etc/pam.d/mate-screensaver (or kde-screensaver, ...)
- Passwordless sudo - edit /etc/pam.d/sudo - Passwordless sudo - edit /etc/pam.d/sudo
Check out your folder **/etc/pam.d/** and do some experiments. Check out your folder **/etc/pam.d/** and do some experiments.
@ -107,36 +78,17 @@ The login passwordless won't make your system more secure, but maybe more comfor
To use Solo as second factor, for login into your Linux system, is nearly the same. To use Solo as second factor, for login into your Linux system, is nearly the same.
``` ```
sudo vim /etc/pam.d/lightdm sudo vim /etc/pam.d/lightdm
``` ```
Now search following entry:
**On Ubuntu**<br>
Search following entry:
``` ```
@include common-auth @include common-auth
``` ```
and add and add
``` ```
auth required pam_u2f.so auth required pam_u2f.so
``` ```
**after** *@include common-auth*. **after** @include common-auth.
<br>
<br>
**On Manjaro**<br>
Search following entry:
```
auth include system-login
```
Add following entry
```
auth required pam_u2f.so
```
**after** *auth include system-login*.
<br>
<br>
Save the file and test it. <br> Save the file and test it. <br>
In case your Solo is not present, your password will be incrorrect. If Solo is plugged into your USB port, it will signal pressing the button and you will be able to login into Linux. In case your Solo is not present, your password will be incrorrect. If Solo is plugged into your USB port, it will signal pressing the button and you will be able to login into Linux.

View File

@ -104,24 +104,9 @@ 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. Use the `--lock` flag By default the "hacker" attestation certifcate and key is used.
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 \
@ -133,5 +118,9 @@ 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).

View File

@ -45,7 +45,7 @@ email=example@example.com
openssl ecparam -genkey -name "$curve" -out root_key.pem -rand seed.bin openssl ecparam -genkey -name "$curve" -out root_key.pem -rand seed.bin
# generate a "signing request" # generate a "signing request"
openssl req -new -key root_key.pem -out root_key.pem.csr -subj "/C=$country/ST=$state/O=$organization/OU=$unit/CN=$CN/emailAddress=$email" openssl req -new -key root_key.pem -out root_key.pem.csr -subj "/C=$country/ST=$state/O=$organization/OU=$unit/CN=example.com/emailAddress=$email"
# self sign the request # self sign the request
openssl x509 -trustout -req -days 18250 -in root_key.pem.csr -signkey root_key.pem -out root_cert.pem -sha256 openssl x509 -trustout -req -days 18250 -in root_key.pem.csr -signkey root_key.pem -out root_cert.pem -sha256
@ -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" # MUST KEEP THIS AS "Authenticator Attestation" for FIDO2. unit="Authenticator Attestation"
CN=example.com CN=example.com
email=example@example.com email=example@example.com
@ -82,7 +82,7 @@ email=example@example.com
openssl ecparam -genkey -name "$curve" -out device_key.pem -rand seed.bin openssl ecparam -genkey -name "$curve" -out device_key.pem -rand seed.bin
# generate a "signing request" # generate a "signing request"
openssl req -new -key device_key.pem -out device_key.pem.csr -subj "/C=$country/ST=$state/O=$organization/OU=$unit/CN=$CN/emailAddress=$email" openssl req -new -key device_key.pem -out device_key.pem.csr -subj "/C=$country/ST=$state/O=$organization/OU=$unit/CN=example.com/emailAddress=$email"
# sign the request # sign the request
openssl x509 -req -days 18250 -in device_key.pem.csr -extfile v3.ext -CA root_cert.pem -CAkey root_key.pem -set_serial 01 -out device_cert.pem -sha256 openssl x509 -req -days 18250 -in device_key.pem.csr -extfile v3.ext -CA root_cert.pem -CAkey root_key.pem -set_serial 01 -out device_cert.pem -sha256
@ -119,7 +119,7 @@ First, [Build your solo application and bootloader](/solo/building).
Print your attestation key in a hex string format. Using our utility script: Print your attestation key in a hex string format. Using our utility script:
``` ```
python3 tools/gencert/print_x_y.py device_key.pem python tools/print_x_y.py device_key.pem
``` ```
Merge the `bootloader.hex`, `solo.hex`, attestion key, and certificate into one firmware file. Merge the `bootloader.hex`, `solo.hex`, attestion key, and certificate into one firmware file.
@ -134,8 +134,6 @@ 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).

View File

@ -36,13 +36,9 @@ So it's important to not mess this up or you may brick your device.
You can use a firmware build from the [latest release](https://github.com/solokeys/solo/releases) or use You can use a firmware build from the [latest release](https://github.com/solokeys/solo/releases) or use
a build that you made yourself. a build that you made yourself.
You need to use a firmware file that has the combined bootloader, application, and attestation key pair (bootloader + firmware + key). You need to use a firmware file that has the combined bootloader and application (or at the very least just the bootloader).
This means using the `bundle-*.hex` file or the `bundle.hex` from your build. This means using the `bundle-*.hex` file or the `bundle.hex` from your build. If you overwrite the Solo flash with a missing bootloader,
it will be bricked.
#### *Warning*
* **If you overwrite the Solo flash with a missing bootloader, it will be bricked**.
* **If you program bootloader and firmware with no attestation, you will run into FIDO registration issues**
We provide two types of bundled builds. The `bundle-hacker-*.hex` build is the hacker build. If you update with this, We provide two types of bundled builds. The `bundle-hacker-*.hex` build is the hacker build. If you update with this,
you will update the bootloader and application, but nothing will be secured. The `bundle-secure-non-solokeys.hex` you will update the bootloader and application, but nothing will be secured. The `bundle-secure-non-solokeys.hex`

View File

@ -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");
check_ret( cbor_value_advance(&map) ); cbor_value_advance(&map);
check_ret( cbor_value_advance(&map) ); cbor_value_advance(&map);
continue; continue;
} }
check_ret(ret); check_ret(ret);
@ -1353,21 +1353,11 @@ 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;

View File

@ -542,9 +542,6 @@ extern void _check_ret(CborError ret, int line, const char * filename);
uint8_t ctaphid_custom_command(int len, CTAP_RESPONSE * ctap_resp, CTAPHID_WRITE_BUFFER * wb); uint8_t ctaphid_custom_command(int len, CTAP_RESPONSE * ctap_resp, CTAPHID_WRITE_BUFFER * wb);
extern void solo_lock_if_not_already();
uint8_t ctaphid_handle_packet(uint8_t * pkt_raw) uint8_t ctaphid_handle_packet(uint8_t * pkt_raw)
{ {
uint8_t cmd = 0; uint8_t cmd = 0;
@ -765,51 +762,34 @@ uint8_t ctaphid_custom_command(int len, CTAP_RESPONSE * ctap_resp, CTAPHID_WRITE
return 1; return 1;
break; break;
// Remove on next release
#if !defined(IS_BOOTLOADER) && defined(SOLO)
case 0x99:
solo_lock_if_not_already();
wb->bcnt = 0;
ctaphid_write(wb, NULL, 0);
return 1;
break;
#endif
#if !defined(IS_BOOTLOADER) && (defined(SOLO_EXPERIMENTAL)) #if !defined(IS_BOOTLOADER) && (defined(SOLO_EXPERIMENTAL))
case CTAPHID_LOADKEY: case CTAPHID_LOADKEY:
/** /**
* Load external key. Useful for enabling backups. * Load external key. Useful for enabling backups.
* bytes: 4 4 96 * bytes: 4 96
* payload: version [maj rev patch RFU]| counter_replacement (BE) | master_key | * payload: | counter_increase (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 != 104) if (len != 100)
{ {
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(2000) > 0) if (ctap_user_presence_test(8000) > 0)
if (ctap_user_presence_test(2000) > 0) if (ctap_user_presence_test(8000) > 0)
{ {
ctap_load_external_keys(ctap_buffer + 8); ctap_load_external_keys(ctap_buffer + 4);
param = ctap_buffer[7]; param = ctap_buffer[3];
param |= ctap_buffer[6] << 8; param |= ctap_buffer[2] << 8;
param |= ctap_buffer[5] << 16; param |= ctap_buffer[1] << 16;
param |= ctap_buffer[4] << 24; param |= ctap_buffer[0] << 24;
ctap_atomic_count(param); ctap_atomic_count(param);
wb->bcnt = 0; wb->bcnt = 0;

View File

@ -1,17 +1,12 @@
#include "version.h" #include "version.h"
#include "app.h"
const version_t firmware_version
#ifdef SOLO
__attribute__ ((section (".flag"))) __attribute__ ((__used__))
#endif
= {
.major = SOLO_VERSION_MAJ,
.minor = SOLO_VERSION_MIN,
.patch = SOLO_VERSION_PATCH,
.reserved = 0
};
const version_t firmware_version __attribute__ ((section (".flag"))) __attribute__ ((__used__)) = {
.major = SOLO_VERSION_MAJ,
.minor = SOLO_VERSION_MIN,
.patch = SOLO_VERSION_PATCH,
.reserved = 0
};
// from tinycbor, for a quick static_assert // from tinycbor, for a quick static_assert
#include <compilersupport_p.h> #include <compilersupport_p.h>

View File

@ -50,15 +50,12 @@ typedef struct {
uint8_t payload[255 - 10]; uint8_t payload[255 - 10];
} __attribute__((packed)) BootloaderReq; } __attribute__((packed)) BootloaderReq;
uint8_t * last_written_app_address = 0;
/** /**
* Erase all application pages. **APPLICATION_END_PAGE excluded**. * Erase all application pages. **APPLICATION_END_PAGE excluded**.
*/ */
static void erase_application() static void erase_application()
{ {
int page; int page;
last_written_app_address = (uint8_t*) 0;
for(page = APPLICATION_START_PAGE; page < APPLICATION_END_PAGE; page++) for(page = APPLICATION_START_PAGE; page < APPLICATION_END_PAGE; page++)
{ {
flash_erase_page(page); flash_erase_page(page);
@ -109,20 +106,17 @@ int is_bootloader_disabled()
uint32_t * auth = (uint32_t *)(AUTH_WORD_ADDR+4); uint32_t * auth = (uint32_t *)(AUTH_WORD_ADDR+4);
return *auth == 0; return *auth == 0;
} }
uint8_t * last_written_app_address;
#include "version.h" #include "version.h"
bool is_firmware_version_newer_or_equal() bool is_firmware_version_newer_or_equal()
{ {
if (last_written_app_address == 0) {
return false;
}
printf1(TAG_BOOT,"Current firmware version: %u.%u.%u.%u (%02x.%02x.%02x.%02x)\r\n", printf1(TAG_BOOT,"Current firmware version: %u.%u.%u.%u (%02x.%02x.%02x.%02x)\r\n",
current_firmware_version.major, current_firmware_version.minor, current_firmware_version.patch, current_firmware_version.reserved, current_firmware_version.major, current_firmware_version.minor, current_firmware_version.patch, current_firmware_version.reserved,
current_firmware_version.major, current_firmware_version.minor, current_firmware_version.patch, current_firmware_version.reserved current_firmware_version.major, current_firmware_version.minor, current_firmware_version.patch, current_firmware_version.reserved
); );
volatile version_t * new_version = ((volatile version_t *) (last_written_app_address-8+4)); volatile version_t * new_version = ((volatile version_t *) last_written_app_address);
printf1(TAG_BOOT,"Uploaded firmware version: %u.%u.%u.%u (%02x.%02x.%02x.%02x)\r\n", printf1(TAG_BOOT,"Uploaded firmware version: %u.%u.%u.%u (%02x.%02x.%02x.%02x)\r\n",
new_version->major, new_version->minor, new_version->patch, new_version->reserved, new_version->major, new_version->minor, new_version->patch, new_version->reserved,
new_version->major, new_version->minor, new_version->patch, new_version->reserved new_version->major, new_version->minor, new_version->patch, new_version->reserved
@ -176,7 +170,6 @@ int bootloader_bridge(int klen, uint8_t * keyh)
uint32_t addr = ((*((uint32_t*)req->addr)) & 0xffffff) | 0x8000000; uint32_t addr = ((*((uint32_t*)req->addr)) & 0xffffff) | 0x8000000;
uint32_t * ptr = (uint32_t *)addr; uint32_t * ptr = (uint32_t *)addr;
uint32_t current_address;
switch(req->op){ switch(req->op){
case BootWrite: case BootWrite:
@ -203,16 +196,9 @@ int bootloader_bridge(int klen, uint8_t * keyh)
printf2(TAG_ERR, "Error, boot check bypassed\n"); printf2(TAG_ERR, "Error, boot check bypassed\n");
exit(1); exit(1);
} }
current_address = addr + len;
if (current_address < (uint32_t) last_written_app_address) {
printf2(TAG_ERR, "Error, only ascending writes allowed.\n");
has_erased = 0;
return CTAP2_ERR_NOT_ALLOWED;
}
last_written_app_address = (uint8_t*) current_address;
// Do the actual write // Do the actual write
flash_write((uint32_t)ptr,req->payload, len); flash_write((uint32_t)ptr,req->payload, len);
last_written_app_address = (uint8_t *)ptr + len - 8 + 4;
break; break;
case BootDone: case BootDone:
// Writing to flash finished. Request code validation. // Writing to flash finished. Request code validation.

View File

@ -84,5 +84,4 @@ 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 -DCBOR_PARSER_MAX_RECURSIONS=3" CFLAGS="$(CFLAGS) -Os"

View File

@ -199,20 +199,6 @@ int solo_is_locked(){
return tag == ATTESTATION_CONFIGURED_TAG && (device_settings & SOLO_FLAG_LOCKED) != 0; return tag == ATTESTATION_CONFIGURED_TAG && (device_settings & SOLO_FLAG_LOCKED) != 0;
} }
// Locks solo flash from debugging. Locks on next reboot.
// This should be removed in next Solo release.
void solo_lock_if_not_already() {
uint8_t buf[2048];
memmove(buf, (uint8_t*)ATTESTATION_PAGE_ADDR, 2048);
((flash_attestation_page *)buf)->device_settings |= SOLO_FLAG_LOCKED;
flash_erase_page(ATTESTATION_PAGE);
flash_write(ATTESTATION_PAGE_ADDR, buf, 2048);
}
/** device_migrate /** device_migrate
* Depending on version of device, migrates: * Depending on version of device, migrates:
* * Moves attestation certificate to data segment. * * Moves attestation certificate to data segment.
@ -577,11 +563,7 @@ uint32_t ctap_atomic_count(uint32_t amount)
return lastc; return lastc;
} }
if (amount > 256){ lastc += amount;
lastc = amount;
} else {
lastc += amount;
}
if (lastc/256 > erases) if (lastc/256 > erases)
{ {

View File

@ -146,14 +146,12 @@ void device_set_clock_rate(DEVICE_CLOCK_RATE param)
case DEVICE_LOW_POWER_IDLE: case DEVICE_LOW_POWER_IDLE:
SET_CLOCK_RATE0(); SET_CLOCK_RATE0();
break; break;
#if !defined(IS_BOOTLOADER)
case DEVICE_LOW_POWER_FAST: case DEVICE_LOW_POWER_FAST:
SET_CLOCK_RATE1(); SET_CLOCK_RATE1();
break; break;
case DEVICE_FAST: case DEVICE_FAST:
SET_CLOCK_RATE2(); SET_CLOCK_RATE2();
break; break;
#endif
} }
} }

View File

@ -1,4 +1,5 @@
ecdsa ecdsa
fido2==0.7.3
intelhex intelhex
pyserial pyserial
solo-python solo-python