From 2136bab1d5193e5d544a9a79961bfb2b9bb89e40 Mon Sep 17 00:00:00 2001 From: nakedible Date: Sun, 15 Apr 2018 23:15:10 +0300 Subject: [PATCH] Use RSA_ENCRYPT_OR_SIGN for generated keys The value RSA_SIGN_ONLY is deprecated in OpenPGP specification, being replaced by key flags. RSA_SIGN_ONLY is not supported by all GnuPG versions, so RSA_ENCRYPT_OR_SIGN should be used for compatibility. I agree to license all rights to my contributions in each modified file exclusively to KryptCo, Inc. --- app/src/androidTest/java/co/krypt/krypton/PGPCodesignTest.java | 2 +- app/src/main/java/co/krypt/krypton/crypto/RSASSHKeyPair.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/androidTest/java/co/krypt/krypton/PGPCodesignTest.java b/app/src/androidTest/java/co/krypt/krypton/PGPCodesignTest.java index 66fa3a93..e658ddcb 100644 --- a/app/src/androidTest/java/co/krypt/krypton/PGPCodesignTest.java +++ b/app/src/androidTest/java/co/krypt/krypton/PGPCodesignTest.java @@ -50,7 +50,7 @@ public void dataSigning_succeeds() throws Exception { SignedSignatureAttributes parsedSig = SignedSignatureAttributes.parse(new DataInputStream(new ByteArrayInputStream(serializedSig))); Assert.assertTrue(parsedSig.attributes.attributes.hashAlgorithm == HashAlgorithm.SHA512); - Assert.assertTrue(parsedSig.attributes.attributes.pkAlgorithm == PublicKeyAlgorithm.RSA_SIGN_ONLY); + Assert.assertTrue(parsedSig.attributes.attributes.pkAlgorithm == PublicKeyAlgorithm.RSA_ENCRYPT_OR_SIGN); Assert.assertTrue(parsedSig.attributes.attributes.type == SignatureType.BINARY); Assert.assertFalse(parsedSig.attributes.attributes.unhashedSubpackets.issuer.header.type.critical); } diff --git a/app/src/main/java/co/krypt/krypton/crypto/RSASSHKeyPair.java b/app/src/main/java/co/krypt/krypton/crypto/RSASSHKeyPair.java index 4daf3302..5e6c5f38 100644 --- a/app/src/main/java/co/krypt/krypton/crypto/RSASSHKeyPair.java +++ b/app/src/main/java/co/krypt/krypton/crypto/RSASSHKeyPair.java @@ -225,7 +225,7 @@ public PublicKeyData pgpPublicKeyData() { public PublicKeyPacketAttributes pgpPublicKeyPacketAttributes() { return new PublicKeyPacketAttributes( created, - PublicKeyAlgorithm.RSA_SIGN_ONLY + PublicKeyAlgorithm.RSA_ENCRYPT_OR_SIGN ); }