Do not allow key import if algorithm is not supported.

Fixes #55

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2026-08-21 00:24:05 +02:00
parent 6c6187106f
commit 5945f39781
+3
View File
@@ -71,6 +71,9 @@ int cmd_put_data(void) {
(apdu.data[0] == ALGO_RSA && apdu.nc < 3))) {
return SW_WRONG_DATA();
}
if (is_algorithm_attr && apdu.nc > 0 && !openpgp_algorithm_attr_supported(apdu.data, apdu.nc)) {
return SW_WRONG_DATA();
}
if (fid == EF_CH_NAME && apdu.nc > 39u) {
return SW_WRONG_DATA();
}