diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e926f6..a9d5871 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,6 +84,7 @@ set(SOURCES ${SOURCES} ) set(USB_ITF_CCID 1) +set(USB_ITF_WCID 1) include(pico-keys-sdk/pico_keys_sdk_import.cmake) if(ESP_PLATFORM) project(pico_hsm) diff --git a/pico-keys-sdk b/pico-keys-sdk index a0e55eb..218441a 160000 --- a/pico-keys-sdk +++ b/pico-keys-sdk @@ -1 +1 @@ -Subproject commit a0e55ebfaed615a7627c63282d57fdfa3b7e106c +Subproject commit 218441a45a50993c585ad74b3d0a632d2cf1124e diff --git a/tools/pico-hsm-tool.py b/tools/pico-hsm-tool.py index 91840be..c06e1ba 100644 --- a/tools/pico-hsm-tool.py +++ b/tools/pico-hsm-tool.py @@ -95,8 +95,10 @@ def parse_args(): subparser_phy = parser_phy.add_subparsers(title='commands', dest='subcommand', required=True) parser_phy_vp = subparser_phy.add_parser('vidpid', help='Sets VID/PID. Use VID:PID format (e.g. 1234:5678)') parser_phy_ledn = subparser_phy.add_parser('led', help='Sets LED GPIO number.') + parser_phy_optwcid = subparser_phy.add_parser('wcid', help='Enable/Disable Web CCID interface.') parser_phy_vp.add_argument('value', help='Value of the PHY option.', metavar='VAL', nargs='?') parser_phy_ledn.add_argument('value', help='Value of the PHY option.', metavar='VAL', nargs='?') + parser_phy_optwcid.add_argument('value', choices=['enable', 'disable'], help='Enable/Disable Web CCID interface.', nargs='?') parser_secure = subparser.add_parser('secure', help='Manages security of Pico HSM.') subparser_secure = parser_secure.add_subparsers(title='commands', dest='subcommand', required=True) @@ -461,6 +463,8 @@ def phy(picohsm, args): val = int(sp[0],16).to_bytes(2, 'big') + int(sp[1],16).to_bytes(2, 'big') elif (args.subcommand == 'led'): val = [int(val)] + elif (args.subcommand == 'wcid'): + val = val == 'enable' ret = picohsm.phy(args.subcommand, val) if (ret): print(f'Current value: {hexlify(ret)}') @@ -468,7 +472,7 @@ def phy(picohsm, args): print('Command executed successfully. Please, restart your Pico Key.') def main(args): - sys.stderr.buffer.write(b'Pico HSM Tool v1.12\n') + sys.stderr.buffer.write(b'Pico HSM Tool v1.14\n') sys.stderr.buffer.write(b'Author: Pol Henarejos\n') sys.stderr.buffer.write(b'Report bugs to https://github.com/polhenarejos/pico-hsm/issues\n') sys.stderr.buffer.write(b'\n\n')