mirror of
https://github.com/polhenarejos/pico-fido.git
synced 2025-12-19 02:48:04 +08:00
Fix increasing counter on make credential.
Closes #6 Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -15,17 +15,17 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "common.h"
|
|
||||||
#include "ctap2_cbor.h"
|
|
||||||
#include "cbor_make_credential.h"
|
#include "cbor_make_credential.h"
|
||||||
|
#include "ctap2_cbor.h"
|
||||||
|
#include "hid/ctap_hid.h"
|
||||||
#include "fido.h"
|
#include "fido.h"
|
||||||
#include "ctap.h"
|
#include "ctap.h"
|
||||||
#include "files.h"
|
#include "files.h"
|
||||||
#include "random.h"
|
|
||||||
#include "hsm.h"
|
|
||||||
#include <math.h>
|
|
||||||
#include "apdu.h"
|
#include "apdu.h"
|
||||||
#include "credential.h"
|
#include "credential.h"
|
||||||
|
#include "mbedtls/sha256.h"
|
||||||
|
#include "random.h"
|
||||||
|
#include "hsm.h"
|
||||||
|
|
||||||
int cbor_make_credential(const uint8_t *data, size_t len) {
|
int cbor_make_credential(const uint8_t *data, size_t len) {
|
||||||
CborParser parser;
|
CborParser parser;
|
||||||
@@ -440,6 +440,9 @@ int cbor_make_credential(const uint8_t *data, size_t len) {
|
|||||||
if (credential_store(cred_id, cred_id_len, rp_id_hash) != 0)
|
if (credential_store(cred_id, cred_id_len, rp_id_hash) != 0)
|
||||||
CBOR_ERROR(CTAP2_ERR_KEY_STORE_FULL);
|
CBOR_ERROR(CTAP2_ERR_KEY_STORE_FULL);
|
||||||
}
|
}
|
||||||
|
ctr++;
|
||||||
|
flash_write_data_to_file(ef_counter, (uint8_t *)&ctr, sizeof(ctr));
|
||||||
|
low_flash_available();
|
||||||
err:
|
err:
|
||||||
CBOR_FREE_BYTE_STRING(clientDataHash);
|
CBOR_FREE_BYTE_STRING(clientDataHash);
|
||||||
CBOR_FREE_BYTE_STRING(pinUvAuthParam);
|
CBOR_FREE_BYTE_STRING(pinUvAuthParam);
|
||||||
|
|||||||
Reference in New Issue
Block a user