• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

canokeys / canokey-core / 8641815413

11 Apr 2024 05:09AM UTC coverage: 79.632% (-0.05%) from 79.681%
8641815413

push

github

web-flow
Merge pull request #80 from canokeys/feature/nfc_switch

add nfc enable switch

0 of 5 new or added lines in 2 files covered. (0.0%)

6490 of 8150 relevant lines covered (79.63%)

553.69 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

54.55
/include/admin.h
1
/* SPDX-License-Identifier: Apache-2.0 */
2
#ifndef CANOKEY_CORE_ADMIN_ADMIN_H_
3
#define CANOKEY_CORE_ADMIN_ADMIN_H_
4

5
#include <apdu.h>
6

7
#define ADMIN_INS_WRITE_FIDO_PRIVATE_KEY 0x01
8
#define ADMIN_INS_WRITE_FIDO_CERT 0x02
9
#define ADMIN_INS_RESET_OPENPGP 0x03
10
#define ADMIN_INS_RESET_PIV 0x04
11
#define ADMIN_INS_RESET_OATH 0x05
12
#define ADMIN_INS_RESET_NDEF 0x07
13
#define ADMIN_INS_TOGGLE_NDEF_READ_ONLY 0x08
14
#define ADMIN_INS_RESET_CTAP 0x09
15
#define ADMIN_INS_READ_CTAP_SM2_CONFIG 0x11
16
#define ADMIN_INS_WRITE_CTAP_SM2_CONFIG 0x12
17
#define ADMIN_INS_RESET_PASS 0x13
18
#define ADMIN_INS_NFC_ENABLE 0x14
19
#define ADMIN_INS_VERIFY 0x20
20
#define ADMIN_INS_CHANGE_PIN 0x21
21
#define ADMIN_INS_WRITE_SN 0x30
22
#define ADMIN_INS_READ_VERSION 0x31
23
#define ADMIN_INS_READ_SN 0x32
24
#define ADMIN_INS_CONFIG 0x40
25
#define ADMIN_INS_FLASH_USAGE 0x41
26
#define ADMIN_INS_READ_CONFIG 0x42
27
#define ADMIN_INS_READ_PASS_CONFIG 0x43
28
#define ADMIN_INS_WRITE_PASS_CONFIG 0x44
29
#define ADMIN_INS_FACTORY_RESET 0x50
30
#define ADMIN_INS_SELECT 0xA4
31
#define ADMIN_INS_VENDOR_SPECIFIC 0xFF
32

33
#define ADMIN_P1_CFG_LED_ON 0x01
34
#define ADMIN_P1_CFG_NDEF 0x04
35
#define ADMIN_P1_CFG_WEBUSB_LANDING 0x05
36

37
typedef struct {
38
    uint32_t led_normally_on : 1;
39
    uint32_t ndef_en : 1;
40
    uint32_t webusb_landing_en : 1;
41
} __packed admin_device_config_t;
42

43
void admin_poweroff(void);
65✔
44
int admin_install(uint8_t reset);
3✔
45
int admin_process_apdu(const CAPDU *capdu, RAPDU *rapdu);
315✔
46
int admin_vendor_specific(const CAPDU *capdu, RAPDU *rapdu);
1✔
47
int admin_vendor_version(const CAPDU *capdu, RAPDU *rapdu);
×
48
int admin_vendor_hw_variant(const CAPDU *capdu, RAPDU *rapdu);
×
49
int admin_vendor_hw_sn(const CAPDU *capdu, RAPDU *rapdu);
×
NEW
50
int admin_vendor_nfc_enable(const CAPDU *capdu, RAPDU *rapdu);
×
51

52
uint8_t cfg_is_led_normally_on(void);
2,006✔
53
uint8_t cfg_is_ndef_enable(void);
20✔
54
uint8_t cfg_is_webusb_landing_enable(void);
×
55

56
#endif // CANOKEY_CORE_ADMIN_ADMIN_H_
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc