diff --git a/src/fr/anssi/smartpgp/Common.java b/src/fr/anssi/smartpgp/Common.java index 317a99a..c4d04de 100644 --- a/src/fr/anssi/smartpgp/Common.java +++ b/src/fr/anssi/smartpgp/Common.java @@ -160,7 +160,7 @@ public final class Common { protected static final short writeAlgorithmInformation(final byte key_tag, final byte[] buf, short off) { 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++] = (byte)6; /* len */ buf[off++] = (byte)0x01; /* RSA */ diff --git a/src/fr/anssi/smartpgp/Constants.java b/src/fr/anssi/smartpgp/Constants.java index 9887a50..c0b42e2 100644 --- a/src/fr/anssi/smartpgp/Constants.java +++ b/src/fr/anssi/smartpgp/Constants.java @@ -224,4 +224,6 @@ public final class Constants { protected static final short AES_BLOCK_SIZE = (short)16; + protected static final boolean RSA_IMPORT_SUPPORTS_FORMAT_1 = false; + }