Fix issue #39: no RSA key import with format 1 by default

This commit is contained in:
Arnaud Fontaine 2021-09-22 15:06:32 +02:00
parent 55c97d590c
commit 461e5fd123
2 changed files with 3 additions and 1 deletions

View File

@ -160,7 +160,7 @@ public final class Common {
protected static final short writeAlgorithmInformation(final byte key_tag, protected static final short writeAlgorithmInformation(final byte key_tag,
final byte[] buf, short off) { final byte[] buf, short off) {
for(short m = 2; m <= 4; ++m) { for(short m = 2; m <= 4; ++m) {
for(byte form = 1; form <= 3; form += 2) { for(byte form = Constants.RSA_IMPORT_SUPPORTS_FORMAT_1 ? 1 : 3; form <= 3; form += 2) {
buf[off++] = key_tag; buf[off++] = key_tag;
buf[off++] = (byte)6; /* len */ buf[off++] = (byte)6; /* len */
buf[off++] = (byte)0x01; /* RSA */ buf[off++] = (byte)0x01; /* RSA */

View File

@ -224,4 +224,6 @@ public final class Constants {
protected static final short AES_BLOCK_SIZE = (short)16; protected static final short AES_BLOCK_SIZE = (short)16;
protected static final boolean RSA_IMPORT_SUPPORTS_FORMAT_1 = false;
} }