File tree Expand file tree Collapse file tree 2 files changed +28
-6
lines changed Expand file tree Collapse file tree 2 files changed +28
-6
lines changed Original file line number Diff line number Diff line change 41
41
#define ALG_RSA_2048 0x07
42
42
#define ALG_ECC_256 0x11
43
43
#define ALG_ECC_384 0x14
44
- #define ALG_ED25519_DEFAULT 0x22 // defined in https://github.com/go-piv/piv-go/pull/69
44
+ #define ALG_ED25519_DEFAULT 0xE0
45
45
#define ALG_RSA_3072_DEFAULT 0x05 // defined in NIST SP 800-78-5 (Initial Public Draft)
46
- #define ALG_RSA_4096_DEFAULT 0x51
47
- #define ALG_X25519_DEFAULT 0x52
46
+ #define ALG_RSA_4096_DEFAULT 0x16
47
+ #define ALG_X25519_DEFAULT 0xE1
48
48
#define ALG_SECP256K1_DEFAULT 0x53
49
49
#define ALG_SM2_DEFAULT 0x54
50
50
@@ -1099,7 +1099,7 @@ static int piv_get_version(const CAPDU *capdu, RAPDU *rapdu) {
1099
1099
if (P1 != 0x00 || P2 != 0x00 ) EXCEPT (SW_WRONG_P1P2 );
1100
1100
if (LC != 0 ) EXCEPT (SW_WRONG_LENGTH );
1101
1101
RDATA [0 ] = 0x05 ;
1102
- RDATA [1 ] = 0x04 ;
1102
+ RDATA [1 ] = 0x07 ;
1103
1103
RDATA [2 ] = 0x00 ;
1104
1104
LL = 3 ;
1105
1105
return 0 ;
Original file line number Diff line number Diff line change @@ -86,8 +86,8 @@ test_ChangePin() {
86
86
assertEquals ' set-mgm-key' 0 $?
87
87
}
88
88
89
- test_RSA2048 () {
90
- for s in 9a 9c 9d 9e; do PIVGenKeyCert $s " /CN=CertAtSlot$s /" RSA2048 ; done
89
+ rsa_tests () {
90
+ for s in 9a 9c 9d 9e; do PIVGenKeyCert $s " /CN=CertAtSlot$s /" $1 ; done
91
91
YPT -a status
92
92
PIVSignDec 9e # PIN not required for key 9e
93
93
for s in 9a 9c 9d; do PIVSignDec $s 1; done
@@ -101,6 +101,18 @@ test_RSA2048() {
101
101
assertEquals ' openssl dgst verify' 0 $?
102
102
}
103
103
104
+ test_RSA2048 () {
105
+ rsa_tests RSA2048
106
+ }
107
+
108
+ test_RSA3072 () {
109
+ rsa_tests RSA3072
110
+ }
111
+
112
+ test_RSA4096 () {
113
+ rsa_tests RSA4096
114
+ }
115
+
104
116
test_ECC256 () {
105
117
for s in 9a 9c 9d 9e; do PIVGenKeyCert $s " /CN=CertAtSlot$s /" ECCP256; done
106
118
YPT -a status
@@ -119,6 +131,16 @@ test_ECC384() {
119
131
assertContains ' CERT' " $out " ' CN = CertAtSlot9c'
120
132
}
121
133
134
+ test_25519 () {
135
+ for s in 9a 9c 9e; do PIVGenKeyCert $s " /CN=CertAtSlot$s /" ED25519; done
136
+ for s in 9d; do PIVGenKeyCert $s " /CN=CertAtSlot$s /" X25519; done
137
+ YPT -a status
138
+ for s in 9a 9c 9e; do PIVSignDec $s 1 s; done # 9a/9c/9e only do the EDDSA
139
+ # PIVSignDec 9d 1 d # 9d only do the EDDH
140
+ # out=$(pkcs15-tool --reader "$RDID" --read-certificate 01 | openssl x509 -text)
141
+ # assertContains 'CERT' "$out" 'CN = CertAtSlot9a'
142
+ }
143
+
122
144
test_PinBlock () {
123
145
out=$( YPT -a verify-pin -P 222222 2>&1 )
124
146
assertContains ' verify-pin' " $out " ' 2 tries left before pin is blocked.'
You can’t perform that action at this time.
0 commit comments