6 Commits
v2.0 ... v2.2

Author SHA1 Message Date
Pol Henarejos
6a10405357 Upgrade to version 2.2
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-07-15 15:16:36 +02:00
Pol Henarejos
1434ef2bd2 Fix for mbedtls 3.6
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-07-15 15:16:36 +02:00
Pol Henarejos
11cb855f81 Fix idVendor and idProduct placeholders for Pico Patcher. Fixes #14 and #15
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-07-15 15:16:31 +02:00
Pol Henarejos
5aba16692d Merge pull request #17 from imkuang/fix_pw1-life-status
Fix conditional error resetting has_pw1 variable
2024-07-15 15:12:26 +02:00
Ming Kuang
886bee5ddc Fix conditional error resetting has_pw1 variable
According to OpenPGP 3.4.1 specifications subsection 4.4.1:
PW status Bytes
1st byte: 00 = PW1 (no. 81) only valid for one PSO:CDS command
          01 = PW1 valid for several PSO:CDS commands

Therefore has_pw1 should be reset to false when the first byte
of the PW status is 0 instead of 1.
2024-07-06 22:09:37 +08:00
Pol Henarejos
20e7c93707 Upgrade patch_vidpid for new Pico Keys SDK.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-05-30 19:16:50 +02:00
5 changed files with 8 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
VERSION_MAJOR="2" VERSION_MAJOR="2"
VERSION_MINOR="0" VERSION_MINOR="2"
rm -rf release/* rm -rf release/*
cd build_release cd build_release

View File

@@ -17,7 +17,7 @@
# 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="4" #Version of Pico CCID Core VERSION_MAJOR="5" #Version of Pico Keys SDK
VERSION_MINOR="0" VERSION_MINOR="0"
echo "----------------------------" echo "----------------------------"

View File

@@ -473,7 +473,7 @@ int inc_sig_count() {
if (!(pw_status = search_by_fid(EF_PW_PRIV, NULL, SPECIFY_EF)) || !pw_status->data) { if (!(pw_status = search_by_fid(EF_PW_PRIV, NULL, SPECIFY_EF)) || !pw_status->data) {
return SW_REFERENCE_NOT_FOUND(); return SW_REFERENCE_NOT_FOUND();
} }
if (file_get_data(pw_status)[0] == 1) { if (file_get_data(pw_status)[0] == 0) {
has_pw1 = false; has_pw1 = false;
} }
file_t *ef = search_by_fid(EF_SIG_COUNT, NULL, SPECIFY_ANY); file_t *ef = search_by_fid(EF_SIG_COUNT, NULL, SPECIFY_ANY);
@@ -1177,10 +1177,10 @@ int store_keys(void *key_ctx, int type, uint16_t key_id, bool use_kek) {
} }
else if (type == ALGO_ECDSA || type == ALGO_ECDH) { else if (type == ALGO_ECDSA || type == ALGO_ECDH) {
mbedtls_ecdsa_context *ecdsa = (mbedtls_ecdsa_context *) key_ctx; mbedtls_ecdsa_context *ecdsa = (mbedtls_ecdsa_context *) key_ctx;
key_size = mbedtls_mpi_size(&ecdsa->d); size_t olen = 0;
kdata[0] = ecdsa->grp.id & 0xff; kdata[0] = ecdsa->grp.id & 0xff;
mbedtls_ecp_write_key(ecdsa, kdata + 1, key_size); mbedtls_ecp_write_key_ext(ecdsa, &olen, kdata + 1, sizeof(kdata) - 1);
key_size++; key_size = olen + 1;
} }
else if (type & ALGO_AES) { else if (type & ALGO_AES) {
if (type == ALGO_AES_128) { if (type == ALGO_AES_128) {

View File

@@ -24,7 +24,7 @@
#define OPGP_VERSION_MINOR (OPGP_VERSION & 0xff) #define OPGP_VERSION_MINOR (OPGP_VERSION & 0xff)
#define PIPGP_VERSION 0x0200 #define PIPGP_VERSION 0x0202
#define PIPGP_VERSION_MAJOR ((PIPGP_VERSION >> 8) & 0xff) #define PIPGP_VERSION_MAJOR ((PIPGP_VERSION >> 8) & 0xff)
#define PIPGP_VERSION_MINOR (PIPGP_VERSION & 0xff) #define PIPGP_VERSION_MINOR (PIPGP_VERSION & 0xff)