Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bcefdb3c84 | ||
|
|
685ee2bbd5 | ||
|
|
6ae2a91e55 | ||
|
|
2373f21994 | ||
|
|
25bddb7230 | ||
|
|
418fa9c143 | ||
|
|
ce9ef47bb2 | ||
|
|
603963123b | ||
|
|
79ce35e944 | ||
|
|
5ddfa6382b | ||
|
|
9a99baafca | ||
|
|
819fb99646 | ||
|
|
35fb97c58f | ||
|
|
3fa5dbccd0 | ||
|
|
b674708955 | ||
|
|
86b508f2ae | ||
|
|
167b6d9770 | ||
|
|
d0c167345e | ||
|
|
ca6affaf5d | ||
|
|
7a77b31760 | ||
|
|
9f069a7e31 | ||
|
|
a0384f67ca | ||
|
|
32c6f60b49 | ||
|
|
0ab5526dac | ||
|
|
eb066472b1 | ||
|
|
a2d1c5cf22 | ||
|
|
436c0744d0 | ||
|
|
223a1e015b | ||
|
|
1491b9d36d | ||
|
|
74aa99afa6 | ||
|
|
c68fe30077 | ||
|
|
21284a9375 | ||
|
|
151f6d134e | ||
|
|
d95d19a85b | ||
|
|
4e2f3ce38d |
6
.gitmodules
vendored
6
.gitmodules
vendored
@@ -1,3 +1,3 @@
|
|||||||
[submodule "pico-ccid"]
|
[submodule "pico-hsm-sdk"]
|
||||||
path = pico-ccid
|
path = pico-hsm-sdk
|
||||||
url = https://github.com/polhenarejos/pico-ccid.git
|
url = ../pico-hsm-sdk
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
#
|
#
|
||||||
# This file is part of the Pico OpenPGP distribution (https://github.com/polhenarejos/pico-openpgp).
|
# This file is part of the Pico OpenPGP distribution (https://github.com/polhenarejos/pico-openpgp).
|
||||||
# Copyright (c) 2022 Pol Henarejos.
|
# Copyright (c) 2022 Pol Henarejos.
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, version 3.
|
# the Free Software Foundation, version 3.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but
|
# This program is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
# General Public License for more details.
|
# General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
@@ -28,75 +28,25 @@ pico_sdk_init()
|
|||||||
|
|
||||||
add_executable(pico_openpgp)
|
add_executable(pico_openpgp)
|
||||||
|
|
||||||
if (NOT DEFINED USB_VID)
|
|
||||||
set(USB_VID 0xFEFF)
|
|
||||||
endif()
|
|
||||||
add_definitions(-DUSB_VID=${USB_VID})
|
|
||||||
if (NOT DEFINED USB_PID)
|
|
||||||
set(USB_PID 0xFCFD)
|
|
||||||
endif()
|
|
||||||
add_definitions(-DUSB_PID=${USB_PID})
|
|
||||||
|
|
||||||
target_sources(pico_openpgp PUBLIC
|
target_sources(pico_openpgp PUBLIC
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/src/ccid/ccid2040.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/src/openpgp/openpgp.c
|
${CMAKE_CURRENT_LIST_DIR}/src/openpgp/openpgp.c
|
||||||
${CMAKE_CURRENT_LIST_DIR}/src/openpgp/files.c
|
${CMAKE_CURRENT_LIST_DIR}/src/openpgp/files.c
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/src/usb/usb_descriptors.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/src/fs/file.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/src/fs/flash.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/src/fs/low_flash.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/src/rng/random.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/src/rng/neug.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/src/ccid/crypto_utils.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/src/ccid/eac.c
|
|
||||||
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/sha256.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/aes.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/sha512.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/rsa.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/bignum.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/platform_util.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/md.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/oid.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/rsa_alt_helpers.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/constant_time.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/ecdsa.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/ecp.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/ecp_curves.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/asn1write.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/hmac_drbg.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/md5.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/ripemd160.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/sha1.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/ecdh.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/cmac.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/cipher.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/cipher_wrap.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/chachapoly.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/camellia.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/chacha20.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/aria.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/poly1305.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/gcm.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/ccm.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/des.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/nist_kw.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/hkdf.c
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library/asn1parse.c
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(pico_openpgp PUBLIC
|
target_include_directories(pico_openpgp PUBLIC
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/src/fs
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/src/openpgp
|
${CMAKE_CURRENT_LIST_DIR}/src/openpgp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/src/ccid
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/src/rng
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/src/usb
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/include
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico-ccid/mbedtls/library
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(HSM_DRIVER "ccid")
|
||||||
|
include(pico-hsm-sdk/pico_hsm_sdk_import.cmake)
|
||||||
|
|
||||||
|
target_compile_options(pico_openpgp PUBLIC
|
||||||
|
-Wall
|
||||||
|
-Werror
|
||||||
|
)
|
||||||
|
|
||||||
pico_add_extra_outputs(pico_openpgp)
|
pico_add_extra_outputs(pico_openpgp)
|
||||||
|
|
||||||
#target_compile_definitions(pico_openpgp PRIVATE MBEDTLS_ECDSA_DETERMINISTIC=1)
|
#target_compile_definitions(pico_openpgp PRIVATE MBEDTLS_ECDSA_DETERMINISTIC=1)
|
||||||
|
|
||||||
target_link_libraries(pico_openpgp PRIVATE pico_stdlib tinyusb_device tinyusb_board pico_multicore hardware_flash hardware_sync hardware_adc pico_unique_id hardware_rtc)
|
target_link_libraries(pico_openpgp PRIVATE pico_hsm_sdk pico_stdlib tinyusb_device tinyusb_board pico_multicore hardware_flash hardware_sync hardware_adc pico_unique_id hardware_rtc)
|
||||||
|
|||||||
30
README.md
30
README.md
@@ -21,13 +21,30 @@ Pico OpenPGP has implemented the following features:
|
|||||||
- USB/CCID support with OpenSC, openssl, etc.
|
- USB/CCID support with OpenSC, openssl, etc.
|
||||||
- Extended APDU support.
|
- Extended APDU support.
|
||||||
- Lifecycle card (termination and activation).
|
- Lifecycle card (termination and activation).
|
||||||
|
- Press-to-confirm button.
|
||||||
|
- User Interaction Flag for enabling/disabling press-to-confirm button.
|
||||||
|
- Key Derivation Function (KDF) for PIN.
|
||||||
|
- Manage Security Environment (MSE).
|
||||||
|
- DEK for internal safe storage.
|
||||||
|
- AES key generation.
|
||||||
|
- AES ciphering and deciphering.
|
||||||
|
- Cardholder certificates support.
|
||||||
|
|
||||||
All these features are compliant with the specification. Therefore, if you detect some behaviour that is not expected or it does not follow the rules of specs, please open an issue.
|
All these features are compliant with the specification. Therefore, if you detect some behaviour that is not expected or it does not follow the rules of specs, please open an issue.
|
||||||
|
|
||||||
### About Gnuk
|
## AES support
|
||||||
This project was inspired by [Gnuk](https://wiki.debian.org/GNUK "Gnuk"), a same project but focused on STM32 processor family. Despite the initial idea was to port Gnuk to the Raspberry Pico family, the underlaying architecture is widely different (although they run on ARM). For instance, the Pico has two ARM cores, with an appropiate SDK able to leverage them. Also, Pico has an internal flash storage, which is farly larger compared to STM32 ROM storage. Finally, the Pico has a complete USB interface based on TinyUSB, which difficults to port Gnuk. These are only few examples of the difficulties of porting Gnuk to the Raspberry Pico.
|
There is no known software that supports AES with OpenPGP. Nevertheless, it can be used with customized PKCS11 modules or interfacing with raw APDU packets.
|
||||||
|
|
||||||
As a consequence, Pico OpenPGP is designed from zero. Well, not strictly from zero, as it borrows some of the buffering between USB and CCID interfaces from Gnuk. Cryptographic operations are implemented with MBEDTLS library.
|
During asymmetric key generation for DEC key, Pico OpenPGP also generates a 32 bits symmetric key for AES operations.
|
||||||
|
|
||||||
|
OpenPGP card 3.4 specifications describe the procedure to perform ciphering (encryption and decryption) with AES via PSO:ENCIPHER and PSO:DECIPHER. Both commands are supported by Pico OpenPGP.
|
||||||
|
|
||||||
|
### About Gnuk
|
||||||
|
This project was inspired by [Gnuk](https://wiki.debian.org/GNUK "Gnuk"), a same project but focused on STM32 processor family. Despite the initial idea was to port Gnuk to the Raspberry Pico family, the underlaying architecture is widely different (although boh run on ARM). For instance, the Pico has two ARM cores, with an appropiate SDK able to leverage them. Also, Pico has an internal flash storage, which is farly larger compared to STM32 ROM storage. Finally, the Pico has a complete USB interface based on TinyUSB, which difficults to port Gnuk. These are only few examples of the difficulties of porting Gnuk to the Raspberry Pico.
|
||||||
|
|
||||||
|
As a consequence, Pico OpenPGP is designed from zero. Well, not strictly from zero, as it borrows some of the cryptographic operations implemented with MbedTLS library.
|
||||||
|
|
||||||
|
Whilst Gnuk is OpenPGP 2.0 with small set of enhancements, Pico OpenPGP aims at being OpenPGP 3.4 compliant, with new features (not present in Gnuk), such as Manage Security Environment (MSE) or UIF.
|
||||||
|
|
||||||
## Security considerations
|
## Security considerations
|
||||||
All secret keys (asymmetric and symmetric) are stored encrypted in the flash memory of the Raspberry Pico. DEK is used as a 256 bit AES key to protect private and secret keys. Keys are never stored in RAM except for signature and decryption operations and only during the process. All keys (including DEK) are loaded and cleared every time to avoid potential security flaws.
|
All secret keys (asymmetric and symmetric) are stored encrypted in the flash memory of the Raspberry Pico. DEK is used as a 256 bit AES key to protect private and secret keys. Keys are never stored in RAM except for signature and decryption operations and only during the process. All keys (including DEK) are loaded and cleared every time to avoid potential security flaws.
|
||||||
@@ -61,7 +78,7 @@ After make ends, the binary file pico_openpgp.uf2 will be generated. Put your pi
|
|||||||
### Keypair generation
|
### Keypair generation
|
||||||
Generating EC keys is almost instant. RSA keypair generation takes some time, specially for 3072 and 4096 bits.
|
Generating EC keys is almost instant. RSA keypair generation takes some time, specially for 3072 and 4096 bits.
|
||||||
### Keypair generation
|
### Keypair generation
|
||||||
Generating EC keys is almost instant. RSA keypair generation takes some time, specially for `3072` and `4096` bits.
|
Generating EC keys is almost instant. RSA keypair generation takes some time, specially for `3072` and `4096` bits.
|
||||||
|
|
||||||
| RSA key length (bits) | Average time (seconds) |
|
| RSA key length (bits) | Average time (seconds) |
|
||||||
| :---: | :---: |
|
| :---: | :---: |
|
||||||
@@ -102,7 +119,7 @@ While processing, the Pico OpenPGP is busy and cannot receive additional command
|
|||||||
|
|
||||||
## Driver
|
## Driver
|
||||||
|
|
||||||
Pico OpenPGP uses the `openpgp` driver provided by [OpenSC](https://github.com/OpenSC/OpenSC/ "OpenSC"). This driver utilizes the standardized PKCS#11 interface to communicate with the user and it can be used with many engines that accept PKCS#11 interface, such as OpenSSL, P11 library or pkcs11-tool.
|
Pico OpenPGP uses the `openpgp` driver provided by [OpenSC](https://github.com/OpenSC/OpenSC/ "OpenSC"). This driver utilizes the standardized PKCS#11 interface to communicate with the user and it can be used with many engines that accept PKCS#11 interface, such as OpenSSL, P11 library or pkcs11-tool.
|
||||||
|
|
||||||
It also accepts the use of GnuPG programs (`gpg` and `gpg2`) to manipulate the card. For instance, it can be used with the `gpg --edit-card --expert` interface to change the cryptographic keys, generate new keypairs or simply set the cardholder name.
|
It also accepts the use of GnuPG programs (`gpg` and `gpg2`) to manipulate the card. For instance, it can be used with the `gpg --edit-card --expert` interface to change the cryptographic keys, generate new keypairs or simply set the cardholder name.
|
||||||
|
|
||||||
@@ -115,7 +132,6 @@ OpenSC relies on PCSC driver, which reads a list (`Info.plist`) that contains a
|
|||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
Pico OpenPGP uses the following libraries or portion of code:
|
Pico OpenPGP uses the following libraries or portion of code:
|
||||||
- mbedTLS for cryptographic operations.
|
- MbedTLS for cryptographic operations.
|
||||||
- gnuk for low level CCID procedures support.
|
|
||||||
- TinyUSB for low level USB procedures.
|
- TinyUSB for low level USB procedures.
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,53 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
VERSION_MAJOR="1"
|
VERSION_MAJOR="1"
|
||||||
VERSION_MINOR="2"
|
VERSION_MINOR="8"
|
||||||
|
|
||||||
rm -rf release/*
|
rm -rf release/*
|
||||||
cd build_release
|
cd build_release
|
||||||
|
|
||||||
for board in adafruit_feather_rp2040 adafruit_itsybitsy_rp2040 adafruit_qtpy_rp2040 adafruit_trinkey_qt2040 arduino_nano_rp2040_connect melopero_shake_rp2040 pimoroni_interstate75 pimoroni_keybow2040 pimoroni_pga2040 pimoroni_picolipo_4mb pimoroni_picolipo_16mb pimoroni_picosystem pimoroni_plasma2040 pimoroni_tiny2040 pybstick26_rp2040 sparkfun_micromod sparkfun_promicro sparkfun_thingplus vgaboard waveshare_rp2040_lcd_0.96 waveshare_rp2040_plus_4mb waveshare_rp2040_plus_16mb waveshare_rp2040_zero
|
for board in adafruit_feather_rp2040 \
|
||||||
|
adafruit_itsybitsy_rp2040 \
|
||||||
|
adafruit_kb2040 \
|
||||||
|
adafruit_macropad_rp2040 \
|
||||||
|
adafruit_qtpy_rp2040 \
|
||||||
|
adafruit_trinkey_qt2040 \
|
||||||
|
arduino_nano_rp2040_connect \
|
||||||
|
datanoisetv_rp2040_dsp \
|
||||||
|
eetree_gamekit_rp2040 \
|
||||||
|
garatronic_pybstick26_rp2040 \
|
||||||
|
melopero_shake_rp2040 \
|
||||||
|
pico \
|
||||||
|
pico_w \
|
||||||
|
pimoroni_badger2040 \
|
||||||
|
pimoroni_interstate75 \
|
||||||
|
pimoroni_keybow2040 \
|
||||||
|
pimoroni_motor2040 \
|
||||||
|
pimoroni_pga2040 \
|
||||||
|
pimoroni_picolipo_4mb \
|
||||||
|
pimoroni_picolipo_16mb \
|
||||||
|
pimoroni_picosystem \
|
||||||
|
pimoroni_plasma2040 \
|
||||||
|
pimoroni_servo2040 \
|
||||||
|
pimoroni_tiny2040 \
|
||||||
|
pimoroni_tiny2040_2mb \
|
||||||
|
seeed_xiao_rp2040 \
|
||||||
|
solderparty_rp2040_stamp \
|
||||||
|
solderparty_rp2040_stamp_carrier \
|
||||||
|
solderparty_rp2040_stamp_round_carrier \
|
||||||
|
sparkfun_micromod \
|
||||||
|
sparkfun_promicro \
|
||||||
|
sparkfun_thingplus \
|
||||||
|
vgaboard \
|
||||||
|
waveshare_rp2040_lcd_0.96 \
|
||||||
|
waveshare_rp2040_plus_4mb \
|
||||||
|
waveshare_rp2040_plus_16mb \
|
||||||
|
waveshare_rp2040_zero \
|
||||||
|
wiznet_w5100s_evb_pico
|
||||||
do
|
do
|
||||||
rm -rf *
|
rm -rf *
|
||||||
PICO_SDK_PATH=~/Devel/pico/pico-sdk cmake .. -DPICO_BOARD=$board
|
PICO_SDK_PATH=../../pico-sdk cmake .. -DPICO_BOARD=$board
|
||||||
make -kj20
|
make -kj20
|
||||||
mv pico_openpgp.uf2 ../release/pico_openpgp_$board-$VERSION_MAJOR.$VERSION_MINOR.uf2
|
mv pico_openpgp.uf2 ../release/pico_openpgp_$board-$VERSION_MAJOR.$VERSION_MINOR.uf2
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
rm -rf *
|
done
|
||||||
PICO_SDK_PATH=~/Devel/pico/pico-sdk cmake ..
|
|
||||||
make -kj20
|
|
||||||
mv pico_openpgp.uf2 ../release/pico_openpgp_pico_generic-$VERSION_MAJOR.$VERSION_MINOR.uf2
|
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#
|
#
|
||||||
# This file is part of the Pico OpenPGP distribution (https://github.com/polhenarejos/pico-openpgp).
|
# This file is part of the Pico OpenPGP distribution (https://github.com/polhenarejos/pico-openpgp).
|
||||||
# Copyright (c) 2022 Pol Henarejos.
|
# Copyright (c) 2022 Pol Henarejos.
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, version 3.
|
# the Free Software Foundation, version 3.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but
|
# This program is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
# General Public License for more details.
|
# General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
VERSION_MAJOR="1" #Version of Pico CCID Core
|
VERSION_MAJOR="3" #Version of Pico CCID Core
|
||||||
VERSION_MINOR="1"
|
VERSION_MINOR="4"
|
||||||
|
|
||||||
echo "----------------------------"
|
echo "----------------------------"
|
||||||
echo "VID/PID patcher for Pico OpenPGP"
|
echo "VID/PID patcher for Pico OpenPGP"
|
||||||
|
|||||||
Submodule pico-ccid deleted from cddc3b2dec
1
pico-hsm-sdk
Submodule
1
pico-hsm-sdk
Submodule
Submodule pico-hsm-sdk added at c4178fda4b
@@ -54,7 +54,7 @@ uint8_t historical_bytes[] = {
|
|||||||
|
|
||||||
uint8_t extended_capabilities[] = {
|
uint8_t extended_capabilities[] = {
|
||||||
10, 0,
|
10, 0,
|
||||||
0x76, /*
|
0x77, /*
|
||||||
* No Secure Messaging supported
|
* No Secure Messaging supported
|
||||||
* GET CHALLENGE supported
|
* GET CHALLENGE supported
|
||||||
* Key import supported
|
* Key import supported
|
||||||
@@ -62,7 +62,7 @@ uint8_t extended_capabilities[] = {
|
|||||||
* No private_use_DO
|
* No private_use_DO
|
||||||
* Algorithm attrs are changable
|
* Algorithm attrs are changable
|
||||||
* ENC/DEC with AES
|
* ENC/DEC with AES
|
||||||
* No KDF-DO available
|
* KDF-DO available
|
||||||
*/
|
*/
|
||||||
0, /* Secure Messaging Algorithm: N/A (TDES=0, AES=1) */
|
0, /* Secure Messaging Algorithm: N/A (TDES=0, AES=1) */
|
||||||
0x00, 128, /* Max size of GET CHALLENGE */
|
0x00, 128, /* Max size of GET CHALLENGE */
|
||||||
@@ -137,9 +137,13 @@ file_t file_entries[] = {
|
|||||||
/* 50 */ { .fid = EF_PB_AUT, .parent = 0, .name = NULL, .type = FILE_TYPE_INTERNAL_EF | FILE_DATA_FLASH, .data = NULL, .ef_structure = FILE_EF_TRANSPARENT, .acl = ACL_R_WP },
|
/* 50 */ { .fid = EF_PB_AUT, .parent = 0, .name = NULL, .type = FILE_TYPE_INTERNAL_EF | FILE_DATA_FLASH, .data = NULL, .ef_structure = FILE_EF_TRANSPARENT, .acl = ACL_R_WP },
|
||||||
/* 51 */ { .fid = EF_PW_PRIV, .parent = 0, .name = NULL, .type = FILE_TYPE_INTERNAL_EF | FILE_DATA_FLASH, .data = NULL, .ef_structure = FILE_EF_TRANSPARENT, .acl = ACL_R_WP },
|
/* 51 */ { .fid = EF_PW_PRIV, .parent = 0, .name = NULL, .type = FILE_TYPE_INTERNAL_EF | FILE_DATA_FLASH, .data = NULL, .ef_structure = FILE_EF_TRANSPARENT, .acl = ACL_R_WP },
|
||||||
/* 52 */ { .fid = EF_DEK, .parent = 0, .name = NULL, .type = FILE_TYPE_INTERNAL_EF | FILE_DATA_FLASH, .data = NULL, .ef_structure = FILE_EF_TRANSPARENT, .acl = ACL_NONE },
|
/* 52 */ { .fid = EF_DEK, .parent = 0, .name = NULL, .type = FILE_TYPE_INTERNAL_EF | FILE_DATA_FLASH, .data = NULL, .ef_structure = FILE_EF_TRANSPARENT, .acl = ACL_NONE },
|
||||||
|
/* 53 */ { .fid = EF_KDF, .parent = 0, .name = NULL, .type = FILE_TYPE_WORKING_EF | FILE_DATA_FLASH, .data = NULL, .ef_structure = FILE_EF_TRANSPARENT, .acl = ACL_R_WP },
|
||||||
|
/* 54 */ { .fid = EF_CH_1, .parent = 0, .name = NULL, .type = FILE_TYPE_INTERNAL_EF | FILE_DATA_FLASH, .data = NULL, .ef_structure = FILE_EF_TRANSPARENT, .acl = ACL_NONE },
|
||||||
|
/* 55 */ { .fid = EF_CH_2, .parent = 0, .name = NULL, .type = FILE_TYPE_INTERNAL_EF | FILE_DATA_FLASH, .data = NULL, .ef_structure = FILE_EF_TRANSPARENT, .acl = ACL_NONE },
|
||||||
|
/* 56 */ { .fid = EF_CH_3, .parent = 0, .name = NULL, .type = FILE_TYPE_INTERNAL_EF | FILE_DATA_FLASH, .data = NULL, .ef_structure = FILE_EF_TRANSPARENT, .acl = ACL_NONE },
|
||||||
|
|
||||||
/* 53 */ { .fid = 0x0000, .parent = 0, .name = openpgp_aid, .type = FILE_TYPE_WORKING_EF, .data = NULL, .ef_structure = FILE_EF_TRANSPARENT, .acl = ACL_RO },
|
/* 57 */ { .fid = 0x0000, .parent = 0, .name = openpgp_aid, .type = FILE_TYPE_WORKING_EF, .data = NULL, .ef_structure = FILE_EF_TRANSPARENT, .acl = ACL_RO },
|
||||||
/* 54 */ { .fid = 0x0000, .parent = 0xff, .name = NULL, .type = FILE_TYPE_UNKNOWN, .data = NULL, .ef_structure = 0, .acl = ACL_NONE } //end
|
/* 58 */ { .fid = 0x0000, .parent = 0xff, .name = NULL, .type = FILE_TYPE_UNKNOWN, .data = NULL, .ef_structure = 0, .acl = ACL_NONE } //end
|
||||||
};
|
};
|
||||||
|
|
||||||
const file_t *MF = &file_entries[0];
|
const file_t *MF = &file_entries[0];
|
||||||
|
|||||||
@@ -35,6 +35,9 @@
|
|||||||
#define EF_PB_DEC 0x10d5
|
#define EF_PB_DEC 0x10d5
|
||||||
#define EF_PB_AUT 0x10d6
|
#define EF_PB_AUT 0x10d6
|
||||||
#define EF_DEK 0x1099
|
#define EF_DEK 0x1099
|
||||||
|
#define EF_CH_1 0x1f21
|
||||||
|
#define EF_CH_2 0x1f22
|
||||||
|
#define EF_CH_3 0x1f23
|
||||||
|
|
||||||
#define EF_EXT_HEADER 0x004d //C
|
#define EF_EXT_HEADER 0x004d //C
|
||||||
#define EF_FULL_AID 0x004f //S
|
#define EF_FULL_AID 0x004f //S
|
||||||
@@ -63,10 +66,12 @@
|
|||||||
#define EF_TS_DEC 0x00cf //S
|
#define EF_TS_DEC 0x00cf //S
|
||||||
#define EF_TS_AUT 0x00d0 //S
|
#define EF_TS_AUT 0x00d0 //S
|
||||||
#define EF_RESET_CODE 0x00d3 //S
|
#define EF_RESET_CODE 0x00d3 //S
|
||||||
|
#define EF_AES_KEY 0x00d5 //S
|
||||||
#define EF_UIF_SIG 0x00d6 //S
|
#define EF_UIF_SIG 0x00d6 //S
|
||||||
#define EF_UIF_DEC 0x00d7 //S
|
#define EF_UIF_DEC 0x00d7 //S
|
||||||
#define EF_UIF_AUT 0x00d8 //S
|
#define EF_UIF_AUT 0x00d8 //S
|
||||||
#define EF_KEY_INFO 0x00de //S
|
#define EF_KEY_INFO 0x00de //S
|
||||||
|
#define EF_KDF 0x00f9 //C
|
||||||
#define EF_ALGO_INFO 0x00fa //C
|
#define EF_ALGO_INFO 0x00fa //C
|
||||||
#define EF_LANG_PREF 0x5f2d //S
|
#define EF_LANG_PREF 0x5f2d //S
|
||||||
#define EF_SEX 0x5f35 //S
|
#define EF_SEX 0x5f35 //S
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,17 +1,17 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of the Pico OpenPGP distribution (https://github.com/polhenarejos/pico-openpgp).
|
* This file is part of the Pico OpenPGP distribution (https://github.com/polhenarejos/pico-openpgp).
|
||||||
* Copyright (c) 2022 Pol Henarejos.
|
* Copyright (c) 2022 Pol Henarejos.
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, version 3.
|
* the Free Software Foundation, version 3.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* General Public License for more details.
|
* General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -21,7 +21,8 @@
|
|||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include <pico/stdlib.h>
|
#include <pico/stdlib.h>
|
||||||
|
|
||||||
#include "ccid2040.h"
|
#include "hsm.h"
|
||||||
|
#include "apdu.h"
|
||||||
|
|
||||||
extern bool has_pw1;
|
extern bool has_pw1;
|
||||||
extern bool has_pw3;
|
extern bool has_pw3;
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of the Pico OpenPGP distribution (https://github.com/polhenarejos/pico-openpgp).
|
* This file is part of the Pico OpenPGP distribution (https://github.com/polhenarejos/pico-openpgp).
|
||||||
* Copyright (c) 2022 Pol Henarejos.
|
* Copyright (c) 2022 Pol Henarejos.
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, version 3.
|
* the Free Software Foundation, version 3.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* General Public License for more details.
|
* General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -23,5 +23,10 @@
|
|||||||
#define OPGP_VERSION_MAJOR ((OPGP_VERSION >> 8) & 0xff)
|
#define OPGP_VERSION_MAJOR ((OPGP_VERSION >> 8) & 0xff)
|
||||||
#define OPGP_VERSION_MINOR (OPGP_VERSION & 0xff)
|
#define OPGP_VERSION_MINOR (OPGP_VERSION & 0xff)
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
#define PIPGP_VERSION 0x0108
|
||||||
|
|
||||||
|
#define PIPGP_VERSION_MAJOR ((PIPGP_VERSION >> 8) & 0xff)
|
||||||
|
#define PIPGP_VERSION_MINOR (PIPGP_VERSION & 0xff)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user