1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-09 18:29:39 +02:00

Compare commits

..

260 commits

Author SHA1 Message Date
82b7bf6c31
Issue templates: Add question about AI tooling 2025-07-27 19:44:20 +02:00
6ca9b6f4ed
Turn var into val 2025-07-24 11:49:47 +02:00
833484450c
Add overridden @Deprecated annotations 2025-07-24 11:49:38 +02:00
2b155b4ec0
Bump dependencies 2025-07-01 23:29:45 +02:00
3fd8b82c9b
Bump sop-java to 14.0.0 2025-06-18 12:16:48 +02:00
15d50bb4af
Bump sop-java to 14.0.0-SNAPSHOT 2025-06-17 13:32:57 +02:00
a49df00a9e
Bump BC to 1.81 + BC/#2105 2025-06-17 13:31:49 +02:00
98c48232f5
EncryptImpl: Emit session-key 2025-06-17 13:31:49 +02:00
9617b35703
Add test for PolicyAdapter properly adapting NotationRegistry implementations 2025-06-17 13:31:49 +02:00
aa1f99fe39
Add tests for SignatureSubpacketsCallback implementations 2025-06-17 13:31:49 +02:00
72ec1b1e06
setPreferredAEADCiphersuites(): Add missing method taking PreferredAEADCiphersuites object 2025-06-17 13:31:49 +02:00
7313c5e5a9
Add missing implementations of then() method 2025-06-17 13:31:48 +02:00
c054cb9705
Remove unused SignatureSubpackets callback related methods 2025-06-17 13:31:48 +02:00
0a639e1c2a
Implement update-key command properly 2025-06-17 13:31:48 +02:00
d789d3e0c4
Add test for CompressionAlgorithmNegotiator 2025-06-17 13:31:48 +02:00
21439854e3
Move SymmetricKeyAlgorithmNegotiatorTest to negotiation package 2025-06-17 13:31:48 +02:00
026be063f8
Swappable algorithm negotiation delegates 2025-06-17 13:31:47 +02:00
fd85f8e567
SOP encrypt --profile=rfc9580: Only override enc mechanism with seipd2 if exclusively symmetric encryption is used 2025-06-17 13:31:47 +02:00
24887e2521
EncryptionMechanismNegotiator: Allow producing AEADED/OED packets 2025-06-17 13:31:47 +02:00
df136adfab
ValidateUserIdImpl: throw CertUserIdNoMatch for unbound user-ids 2025-06-17 13:31:47 +02:00
8f24bcfb26
SOP encrypt: Add profile for rfc9580 2025-06-17 13:31:47 +02:00
76820b8cd5
Enable additional profiles 2025-06-17 13:31:47 +02:00
0027a3ed24
SOP generate-key: Implement additional profiles 2025-06-17 13:31:46 +02:00
e45b551ab3
SOP generate-key: Add rfc9580 profile 2025-06-17 13:31:46 +02:00
a575f46867
Move EncryptionMechanismNegotiator into own interface, improve negotiation 2025-06-17 13:31:46 +02:00
65e2de8186
Replace usage of KeyIdentifier.matches() with matchesExplicitly() 2025-06-17 13:31:46 +02:00
46367aff93
Remove SignerUserIdValidation enum 2025-06-17 13:31:46 +02:00
18a49d0afd
Add deprecation notices 2025-06-17 13:31:45 +02:00
45a79a0e65
WIP: EncryptionMechanismPolicy 2025-06-17 13:31:45 +02:00
5b39aea421
Improve GnuPGDummyKeyUtilTest 2025-06-17 13:31:45 +02:00
4e5eff6113
Test v6 key revocation 2025-06-17 13:31:45 +02:00
946d8aace0
Test edge-cases in inline-detach operation 2025-06-17 13:31:45 +02:00
bfd67abab7
Document KOpenPGP mitigations 2025-06-17 13:31:44 +02:00
aa4ffbaba5
Simplify SessionKey conversion 2025-06-17 13:31:44 +02:00
7b32da722f
Document KOpenPGP mitigations 2025-06-17 13:31:44 +02:00
c914a43853
Fix more javadoc references 2025-06-17 13:31:44 +02:00
4405c579a1
Fix references in javadoc 2025-06-17 13:31:44 +02:00
4462abce9f
Add OpenPGPCertificateUtil and unify the way, SOP encodes/armors certificates/keys 2025-06-17 13:31:44 +02:00
4d8179edc1
KeyRingReaderTest: Remove unused import 2025-06-17 13:31:43 +02:00
f786de4c54
TestAllImplementations: Fix javadoc 2025-06-17 13:31:43 +02:00
eaeb0e1ab2
Fix test 2025-06-17 13:31:43 +02:00
ed92f321dd
Generate-Key: Use new packet tags 2025-06-17 13:31:43 +02:00
f97591a509
Add missing license headers 2025-06-17 13:31:43 +02:00
8c7e9e1b54
Add documentation 2025-06-17 13:31:42 +02:00
f3b5664d95
Update documentation of AEADAlgorithm 2025-06-17 13:31:42 +02:00
82db3a9ea6
Port CertificateAuthority to KeyIdentifier, add tests for authenticated cert selection 2025-06-17 13:31:42 +02:00
06d0b90ff6
Add tests for LongExtension methods 2025-06-17 13:31:42 +02:00
88d9fae2fc
Add test and documentation to DateExtensions 2025-06-17 13:31:42 +02:00
2714c9770b
Some updates to the README file 2025-06-17 13:31:41 +02:00
e44e97844c
Add AEADAlkgorithm.toMechanism(SymAlg) shortcut method 2025-06-17 13:31:41 +02:00
48ba9dbe98
Update README 2025-06-17 13:31:41 +02:00
ab34413fa8
Port GnuPGDummyExtension implementation 2025-06-17 13:31:41 +02:00
a76128cf79
Port Exception classes to Kotlin 2025-06-17 13:31:41 +02:00
65f341f687
Remove usage of OpenPgpKeyAttributeUtil 2025-06-17 13:31:40 +02:00
a0ef949bb4
Port OpenPGPInputStream to Kotlin as OpenPGPAnimalSnifferInputStream 2025-06-17 13:31:40 +02:00
21246138aa
Typo 2025-06-17 13:31:40 +02:00
01c112770a
Clean up OnePassSignatureCheck 2025-06-17 13:31:40 +02:00
7c22d32a11
Remove unused SignatureComparator classes 2025-06-17 13:31:40 +02:00
3e867be780
Fix comment block layout 2025-06-17 13:31:40 +02:00
2d0e4b4fc0
Update documentation of SignatureVerification 2025-06-17 13:31:39 +02:00
1b6601cc19
Rework ASCII armor API 2025-06-17 13:31:39 +02:00
02d72c2691
Add documentation to PGPainless class 2025-06-17 13:31:39 +02:00
244113bc2f
Replace static decryptAndOrVerify() method with non-static processMessage() function 2025-06-17 13:31:39 +02:00
3bc07f045c
Prevent NULL encryption algorithm 2025-06-17 13:31:39 +02:00
76efbf2e45
Test encryptionMechanismOverride for symmetric and asymmetric encryption 2025-06-17 13:31:38 +02:00
f7dd72dd79
Respect encryptionMechanismOverride 2025-06-17 13:31:38 +02:00
6e8982df59
Remove debugging prints 2025-06-17 13:31:38 +02:00
ab6ab04bcb
Add documentation 2025-06-17 13:31:38 +02:00
dc2fe5d65a
Rework OpenPGPInputStream to rely on BCPGInputStream for packet parsing 2025-06-17 13:31:38 +02:00
05ea7bd94f
Workaround for OpenPGPInputStream to recognize PKESKv6 packets 2025-06-17 13:31:38 +02:00
c2f7a8b2fd
Fix checkstyle issues 2025-06-17 13:31:37 +02:00
333addf262
Move negotiation tests to dedicated test class 2025-06-17 13:31:37 +02:00
cc4928ab22
First draft for SEIPD2 negotiation 2025-06-17 13:31:37 +02:00
0266d14594
Rework KeyAccessor 2025-06-17 13:31:37 +02:00
94febc33df
Expose encryption mechanism during decryption 2025-06-17 13:31:37 +02:00
3cef99d256
Add BUILD.md 2025-06-17 13:31:36 +02:00
48f000f6f4
Update README 2025-06-17 13:31:36 +02:00
bdd5a9e26e
Raise kotlin lib version 2025-06-17 13:31:36 +02:00
9343e1e0f2
Remove duplicate line in build.gradle 2025-06-17 13:31:36 +02:00
1dd666d32b
Implement crude update-key command (only merges certs for now) 2025-06-17 13:31:36 +02:00
b7dedbd619
SOP certify-userid: Properly throw KeyCannotCertify exception 2025-06-17 13:31:36 +02:00
d540febc7f
Add PGPainlessCertifyValidateUserIdTest 2025-06-17 13:31:35 +02:00
168c884f27
Certify-UserId: Throw proper exception on unbound user-id 2025-06-17 13:31:35 +02:00
148af79794
Set relaxed PK policies for tests with weak DSA keys 2025-06-17 13:31:35 +02:00
85856567dd
Fix checkstyle issues 2025-06-17 13:31:35 +02:00
4797ce34c3
Add comments 2025-06-17 13:31:35 +02:00
68be1ffc5f
SOP: Implement merge-certs subcommand 2025-06-17 13:31:34 +02:00
9f2371932e
Update SOP version in VersionImpl 2025-06-17 13:31:34 +02:00
24cef79831
Add PublicKeyAlgorithmPolicy based on rfc9580 2025-06-17 13:31:34 +02:00
3080e8bdd3
Implement SOPs validate-userid command 2025-06-17 13:31:34 +02:00
2d1c2d2737
Implement SOPs certify-userid command 2025-06-17 13:31:34 +02:00
1b19634415
SOP-Java: These go to 11 2025-06-17 13:31:32 +02:00
c7c3d5b3ab
HardwareSecurity: Replace usage of Long KeyId with KeyIdentifier 2025-06-17 13:31:10 +02:00
f3257d9405
Remove unused test 2025-06-17 13:31:10 +02:00
b8f41b6212
Port ReadKeys example 2025-06-17 13:31:10 +02:00
96fa3af08c
Port Encrypt example 2025-06-17 13:31:10 +02:00
ff62a39dc8
Port DecryptOrVerify example 2025-06-17 13:31:10 +02:00
187416bbe1
Port EncryptDecryptTest 2025-06-17 13:31:09 +02:00
d1861e51cd
Improve API for signatures in results 2025-06-17 13:31:09 +02:00
654756c919
Replace all remaining usages of PGPainless.generateKeyRing() 2025-06-17 13:31:09 +02:00
2d6675ec06
Add tests for v6<->v4 certificate certification 2025-06-17 13:31:09 +02:00
7281ce530a
Port KeyWithUnknownSecretKeyEncryptionMethodTest 2025-06-17 13:31:09 +02:00
8aaa042087
Port a bunch of more tests 2025-06-17 13:31:09 +02:00
bab5a4b0bf
Add missing methods for SecretKeyRing protection 2025-06-17 13:31:08 +02:00
a8a09b7db7
Add OpenPGPSecretKey.unlock(Passphrase) extension method 2025-06-17 13:31:08 +02:00
e2d8db6796
Port BcHashContextSigner and test 2025-06-17 13:31:08 +02:00
bd24db9cc6
Port TryDecryptWithUnavailableGnuDummyKeyTest 2025-06-17 13:31:08 +02:00
9f35be1b0e
Port more tests 2025-06-17 13:31:08 +02:00
bb64188473
Port some more tests 2025-06-17 13:31:07 +02:00
54d83daee5
Port UnlockSecretKey method 2025-06-17 13:31:07 +02:00
cad89b9bde
Small javadoc fixes 2025-06-17 13:31:07 +02:00
c22a2e4fcf
Add test for overriding features during key generation 2025-06-17 13:31:07 +02:00
2dea73c584
KeySpecBuilder: Expose API for overriding default AEAD algorithms and features 2025-06-17 13:31:07 +02:00
47ec445ef7
Add missing javadoc to SigningOptions 2025-06-17 13:31:06 +02:00
ca22446f1c
Remove API instance parameter from ProducerOptions 2025-06-17 13:31:06 +02:00
41251296ce
Port ConvertKeys example 2025-06-17 13:31:06 +02:00
a37f6dfce9
Port GenerateKeys examples 2025-06-17 13:31:06 +02:00
69b0b2d371
Port PGPPublicKeyRingTest 2025-06-17 13:31:06 +02:00
1e67447efd
Port ExtractCertCmdTest 2025-06-17 13:31:06 +02:00
5f3e1b4da3
generate-key: Use API instance when generating keys 2025-06-17 13:31:05 +02:00
53b44e2817
Migrate GenerateKeyWithoutUserIdTest 2025-06-17 13:31:05 +02:00
c8694840d8
Migrate some tests to new API 2025-06-17 13:31:05 +02:00
c7ce79a5af
IntegrityProtectedInputStream: remove useless logger 2025-06-17 13:31:05 +02:00
e2832249cb
Remove SignatureValidator methods 2025-06-17 13:31:05 +02:00
2c1d89a249
Remove unused SignatureValidator methods 2025-06-17 13:31:04 +02:00
cb7c61cf10
Replace SignatureVerifier usage with BC API 2025-06-17 13:31:04 +02:00
053eb2c830
Remove usage of deprecated methods in SOP implementations 2025-06-17 13:31:04 +02:00
7db10432fe
Port MessageInspector 2025-06-17 13:31:04 +02:00
e2d79e00cc
KeyRingUtils: Use KeyIdentifier instead of keyId 2025-06-17 13:31:04 +02:00
793ee40290
KeyRingReader: Replace usage of deprecated PGPainless method with BC method 2025-06-17 13:31:04 +02:00
3b9858f9ef
Improve readability of OpenPGPMessageInputStream 2025-06-17 13:31:03 +02:00
c88d1573d7
Remove duplicate Padding parser branch 2025-06-17 13:31:03 +02:00
364bebed14
Replace KeyRingUtils usage with toCertificate() 2025-06-17 13:31:03 +02:00
0fbf7fac04
KeyRingInfo: Apply latest method name change from BC 2025-06-17 13:31:03 +02:00
8c58ca620d
Rename new CertifyCertificate API methods and add revocation methods 2025-06-17 13:31:03 +02:00
a8cbd36a52
Test v6 third party certification generation 2025-06-17 13:31:02 +02:00
4a7e690806
CertifyCertificate: Change visibility of internal members to private 2025-06-17 13:31:02 +02:00
312a00e5d4
Remove Tuple class 2025-06-17 13:31:02 +02:00
57b6795513
Remove unused KeyRingSelectionStrategy implementations 2025-06-17 13:31:02 +02:00
acbb93066e
Rework some more tests 2025-06-17 13:31:02 +02:00
9a7aeae9fa
Port SigningTest 2025-06-17 13:31:02 +02:00
bab448eb6d
Introduce PGPainless.toKeyOrCertificate(PGPKeyRing) and constrain argument type of PGPainless.toCertificate(PGPPublicKeyRing) 2025-06-17 13:31:01 +02:00
221d329254
Remove SignerUserId check, Policy setting only via constructor parameter 2025-06-17 13:31:01 +02:00
4c180bbd59
Port signature validation to BC 2025-06-17 13:31:01 +02:00
63d1f855de
Rework ModifiedPublicKeysInvestigation 2025-06-17 13:31:01 +02:00
e61c3007c0
Avoid usage of PGPainless.getPolicy() 2025-06-17 13:31:01 +02:00
c8880619f9
KeySpecBuilder: Do not use PGPainless.getPolicy() method 2025-06-17 13:31:00 +02:00
2d42457ce4
Policy is no longer a Singleton 2025-06-17 13:31:00 +02:00
b24d0ef99c
Determine, whether to use AEAD by cosulting KeyRingProtectionSettings 2025-06-17 13:31:00 +02:00
2ae9c94841
Port SelectUserId.validUserIds() 2025-06-17 13:31:00 +02:00
a00a90c175
Change argument type for toCertificate() method to more general PGPKeyRing 2025-06-17 13:31:00 +02:00
3a28b33355
Delete SignaturePicker class 2025-06-17 13:31:00 +02:00
eefc622f63
Fix test name 2025-06-17 13:30:59 +02:00
665db5ceb6
Port more extension functions 2025-06-17 13:30:59 +02:00
b828e5477c
Migrate some extension functions 2025-06-17 13:30:59 +02:00
053f6cf362
PGPSignatureExtensions: Port wasIssuedBy() to KeyIdentifier 2025-06-17 13:30:59 +02:00
8a48cc40f7
Update some examples in the README file 2025-06-17 13:30:59 +02:00
2200cb7372
SOP: Inject API instance 2025-06-17 13:30:58 +02:00
57540d8028
Port SecretKeyRingEditor, replace Singleton usage with API instance calls 2025-06-17 13:30:58 +02:00
2a71a98bba
Add more deprecation annotations, workaround for BC armor bug 2025-06-17 13:30:58 +02:00
74c821c1e8
GnuPGDummyKeyUtil: Migrate to KeyIdentifier 2025-06-17 13:30:58 +02:00
bca4ddcb6f
Remove ProviderFactory classes
It is no longer possible to inject custom SecurityProviders.
Instead, you can create and inject your own implementation of BCs OpenPGPImplementation
2025-06-17 13:30:58 +02:00
04160fbe27
Fix javadoc parameter names 2025-06-17 13:30:57 +02:00
429186c5e1
UserId: Remove deprecated method usage 2025-06-17 13:30:57 +02:00
b181efee00
KeyRingUtils: Replace deprecated method usage 2025-06-17 13:30:57 +02:00
7a5ece0907
Replace deprecated method usage and make policy injectable in UnlockSecretKey utility class 2025-06-17 13:30:57 +02:00
77890cc933
Remove deprecated KeyInfo class
If you relied on it, replace its usage with the Kotlin extension functions as documented.
If you are using Java, use static methods from PGPPublicKeyExtensionsKt and PGPSecretKeyExtensionsKt instead.
2025-06-17 13:30:57 +02:00
93ee037ef0
Move default parameters of Options classes to factory methods 2025-06-17 13:30:57 +02:00
12fd807f75
ConsumerOptions: Pass down API 2025-06-17 13:30:56 +02:00
7e345a0e33
More API down-handing 2025-06-17 13:30:56 +02:00
f74932c4d0
Cleanup PGPainless class 2025-06-17 13:30:56 +02:00
8a9b5aa567
Pass down API instance in more places 2025-06-17 13:30:56 +02:00
0e48e94a91
Pass down API instance 2025-06-17 13:30:56 +02:00
1967483984
More code cleanup 2025-06-17 13:30:55 +02:00
62f3a35c02
Add documentation 2025-06-17 13:30:55 +02:00
d6d52cd544
Code cleanup 2025-06-17 13:30:55 +02:00
1e7a357b68
Allow passing creation time into KeyRingTemplates, replace deprecated methods 2025-06-17 13:30:55 +02:00
0ff347b836
Fix GenerateV6KeyTest.generateAEADProtectedModernKey() test 2025-06-17 13:30:55 +02:00
e284fca0f8
Rework Policy to be immutable. Changes are now done by calling policy.copy().withXYZ().build() 2025-06-17 13:30:54 +02:00
33ee03ee35
PublicKeyAlgorithms: Update documentation 2025-06-17 13:30:54 +02:00
6cfa87201b
PublicKeyAlgorithm: Ask PublicKeyUtils for algorithm capabilities, add persistent symmetric key algorithm ids 2025-06-17 13:30:54 +02:00
a95ebce07b
Add OpenPGPImplementation.checksumCalculator() extension function 2025-06-17 13:30:54 +02:00
6c68285a95
Replace usage of .let() 2025-06-17 13:30:54 +02:00
97e6591f0a
Make secret key protection settings customizable via policy 2025-06-17 13:30:54 +02:00
16a2e77776
Copy deprecation annotation 2025-06-17 13:30:53 +02:00
aace92214a
Rename parameter 2025-06-17 13:30:53 +02:00
d92ae054d9
Use relaxed PBE parameters 2025-06-17 13:30:53 +02:00
18cdf6bbc7
WIP: Migrate SecretKeyRingEditor 2025-06-17 13:30:53 +02:00
3abc2a4e39
Transform SignatureSubpackets class into simple wrapper around PGPSignatureSubpacketGenerator 2025-06-17 13:30:53 +02:00
a25ba5943e
Avoid deprecated API and remove unnecessary code 2025-06-17 13:30:52 +02:00
34633cfeac
Tests: Avoid usage of now deprecated functionality 2025-06-17 13:30:52 +02:00
42c262a99f
Remove ImplementationFactory in favor of BCs OpenPGPImplementation 2025-06-17 13:30:52 +02:00
321053d66e
SigningOptions: Properly init PGPSignatureGenerator to support v6 keys 2025-06-17 13:30:52 +02:00
fc87d985b6
Policy: Change default compression algorithm to UNCOMPRESSED 2025-06-17 13:30:52 +02:00
f9c2ade2d0
Implement applying algorithm preferences as extension functions 2025-06-17 13:30:52 +02:00
8b5d9af522
buildKey(): Use BC KeyGenerator, but apply PGPainless algorithm preferences 2025-06-17 13:30:51 +02:00
d34cb2db61
Add missing method implementations 2025-06-17 13:30:51 +02:00
5de1e6a56d
Work on AlgorithmSuite 2025-06-17 13:30:51 +02:00
67af718db9
Fix: Do not set IssuerKeyId on v6 key-signatures 2025-06-17 13:30:51 +02:00
69fc590d26
Progress on the migration guide 2025-06-17 13:30:51 +02:00
44d90c600f
Start working on migration guide 2025-06-17 13:30:50 +02:00
9812d4d78c
Add some missing documentation to ConsumerOptions 2025-06-17 13:30:50 +02:00
996984cbb5
Rework OnePassSignatureCheck 2025-06-17 13:30:50 +02:00
63bdff58bf
Add documentation to PolicyAdapter 2025-06-17 13:30:50 +02:00
ac0c37925a
Add getKeyVersion() extension methods to certificate + subclasses and use it in KeyRingInfo.version 2025-06-17 13:30:50 +02:00
07d2311b0e
Fix more spotless formatting errors 2025-06-17 13:30:49 +02:00
0109624020
Fix spotless error 2025-06-17 13:30:49 +02:00
714b5bd9c9
Add comments to OpenPGPKeyVersion 2025-06-17 13:30:49 +02:00
f70792f92d
Add comments to HashAlgorithm 2025-06-17 13:30:49 +02:00
446b8eaaca
Add javadoc 2025-06-17 13:30:49 +02:00
22a1f54a9b
Clean up KeyAccessor class 2025-06-17 13:30:49 +02:00
e53e4f5f3c
Complete migration of KeyRingInfo to KeyIdentifier, javadoc 2025-06-17 13:30:48 +02:00
c00a9709de
Replace KeyRingInfo.publicKey with primaryKey 2025-06-17 13:30:48 +02:00
3030f2af2b
Improve KeyRingInfos getPreferences implementations 2025-06-17 13:30:48 +02:00
1379942c07
Migrate from MissingPublicKeyCallback to OpenPGPCertifcateProvider 2025-06-17 13:30:48 +02:00
0fc9ee716e
Fix addSubkey method 2025-06-17 13:30:48 +02:00
b61ba46d24
Fix some tests 2025-06-17 13:30:47 +02:00
88df92fd1f
Port SignatureBuilders over to new classes 2025-06-17 13:30:46 +02:00
975548fc76
Rename and document members of SubkeyIdentifier 2025-06-17 13:29:32 +02:00
2a2595a757
OpenPGPFingerprint(s): Use FingerprintUtil to calculate key-ids 2025-06-17 13:29:32 +02:00
58a96b5776
Remove unnecessary imports 2025-06-17 13:29:32 +02:00
0583a826d1
Add workaround for decryption with non-encryption subkey 2025-06-17 13:29:31 +02:00
fac87c371a
Fix version 2025-06-17 13:29:31 +02:00
23cb47365e
Port CanonicalizedDataEncryptionTest 2025-06-17 13:29:31 +02:00
0ea19d3b9a
Port Sign and UnlockSecretKeys examples 2025-06-17 13:29:31 +02:00
9e9ccc8624
Port ReadKeys example 2025-06-17 13:29:31 +02:00
df1d74962b
Progress porting the example tests 2025-06-17 13:29:31 +02:00
c0b6ea8f96
Improve KeyExceptions 2025-06-17 13:29:30 +02:00
3e8dd78e74
OpenPGPFingerprint: Add factory methods for new key / subkey classes 2025-06-17 13:29:30 +02:00
a54382a78e
Port test 2025-06-17 13:29:30 +02:00
0b4f1a0f01
Port EncryptionOptions over to OpenPGPCertificate 2025-06-17 13:29:30 +02:00
8c557ad945
Port ConsumerOptions, SigningOptions to new OpenPGPCertificate, OpenPGPKey classes 2025-06-17 13:29:30 +02:00
0c7055455b
Reenable disabled test and add workaround for broken one 2025-06-17 13:29:29 +02:00
0b165ee273
Even more migration and code compiles again 2025-06-17 13:29:29 +02:00
217a25bd62
WIP: Transform Options and OpenPgpMessageInputStream 2025-06-17 13:29:29 +02:00
53053cf3fc
Change return type of KeyRingBuilder.build() to OpenPGPKey 2025-06-17 13:29:29 +02:00
dd4a989606
WIP: Migrate away from static methods 2025-06-17 13:29:29 +02:00
66a2b7e0fc
Begin transition to instance-based PGPainless, adapt policy 2025-06-17 13:29:29 +02:00
ead93345e4
Tests: Remove unused throws declarations 2025-06-17 13:29:28 +02:00
7991af06d4
Fix tests 2025-06-17 13:29:28 +02:00
69f802d442
KeyRingInfo: Replace PGPainless signature evaluation with BCs 2025-06-17 13:29:28 +02:00
b488b70050
Disable ElGamal key tests 2025-06-17 13:29:28 +02:00
41a1d0d596
KeyRingInfo: Expose OpenPGPComponentKey in place of PGPPublicKey, OpenPGPSecretKey instead of PGPSecretKey 2025-06-17 13:29:28 +02:00
1738fb1d7d
Change type of KeyRingInfo.publicKey to OpenPGPPrimaryKey 2025-06-17 13:29:27 +02:00
5938ea9cff
Further integration of OpenPGPCertificate into KeyRingInfo 2025-06-17 13:29:27 +02:00
c9a7accec8
Add some debug checks to test 2025-06-17 13:29:27 +02:00
70cb9df8a9
Fix some tests 2025-06-17 13:29:27 +02:00
4ecc590d8f
Fix test stability 2025-06-17 13:29:27 +02:00
f9d217c0b1
Start porting KeyRingInfo over to OpenPGPCertificate 2025-06-17 13:29:26 +02:00
2b9c6e58ed
Integrate KeyIdentifier with SubkeyIdentifier 2025-06-17 13:29:26 +02:00
b571dd177e
Add missing license headers 2025-06-17 13:29:26 +02:00
0fceb4db2d
Basic v6 key generation test 2025-06-17 13:29:26 +02:00
da9c610d14
Add new key types to default policy 2025-06-17 13:29:26 +02:00
c6dbc029d7
Add new key types X25519, X448, Ed25519, Ed448 2025-06-17 13:29:26 +02:00
2a43d5704b
Pass version down in tests 2025-06-17 13:29:25 +02:00
31e6f2e73a
Allow passing version number to key generator 2025-06-17 13:29:25 +02:00
edea8121ce
Simplify code for setExpirationDate() 2025-06-17 13:29:25 +02:00
1acda0e970
Adapt PGPKeyPairGenerator and remove support for generating ElGamal keys 2025-06-17 13:29:25 +02:00
87f3d28567
PGPainless 2.0.0-SNAPSHOT 2025-06-17 13:29:23 +02:00
37042467f4
Bump bc to 1.80-SNAPSHOT, sop-java to 10.1.0-SNAPSHOT 2025-06-17 13:29:07 +02:00
8 changed files with 17 additions and 37 deletions

View file

@ -36,7 +36,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'java-kotlin' ]
language: [ 'java' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support
@ -46,7 +46,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@ -57,7 +57,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3
uses: github/codeql-action/autobuild@v2
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@ -71,4 +71,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v2

View file

@ -38,11 +38,6 @@ abstract class KeyException : RuntimeException {
) {
constructor(cert: OpenPGPCertificate, expirationDate: Date) : this(of(cert), expirationDate)
constructor(
componentKey: OpenPGPComponentKey,
expirationDate: Date
) : this(of(componentKey), expirationDate)
}
class RevokedKeyException : KeyException {

View file

@ -52,7 +52,7 @@ class KeyRingBuilder(private val version: OpenPGPKeyVersion, private val api: PG
}
override fun addUserId(userId: CharSequence): KeyRingBuilder = apply {
userIds[userId.toString()] = null
userIds[userId.toString().trim()] = null
}
override fun addUserId(userId: ByteArray): KeyRingBuilder =

View file

@ -35,8 +35,7 @@ class KeyRingInfo(
api: PGPainless = PGPainless.getInstance(),
referenceDate: Date = Date()
) : this(
if (keys is PGPSecretKeyRing) OpenPGPKey(keys, api.implementation)
else OpenPGPCertificate(keys, api.implementation),
if (keys is PGPSecretKeyRing) OpenPGPKey(keys) else OpenPGPCertificate(keys),
api,
referenceDate)

View file

@ -532,7 +532,7 @@ class SecretKeyRingEditor(
val prevBinding =
api.inspect(key).getCurrentSubkeyBindingSignature(keyId)
?: throw NoSuchElementException(
"Previous subkey binding signature for $keyId MUST NOT be null.")
"Previous subkey binding signaure for $keyId MUST NOT be null.")
val bindingSig = reissueSubkeyBindingSignature(subkey, expiration, protector, prevBinding)
secretKeyRing =
injectCertification(secretKeyRing, subkey.pgpPublicKey, bindingSig.signature)
@ -624,10 +624,9 @@ class SecretKeyRingEditor(
}
private fun sanitizeUserId(userId: CharSequence): CharSequence =
// I'm not sure, what kind of sanitization is needed.
// Newlines are allowed, they just need to be escaped when emitted in an ASCII armor header
// Trailing/Leading whitespace is also fine.
userId.toString()
// TODO: Further research how to sanitize user IDs.
// e.g. what about newlines?
userId.toString().trim()
private fun callbackFromRevocationAttributes(attributes: RevocationAttributes?) =
object : RevocationSignatureSubpackets.Callback {

View file

@ -247,8 +247,7 @@ class ArmorUtils {
.add(OpenPgpFingerprint.of(publicKey).prettyPrint())
// Primary / First User ID
(primary ?: first)?.let {
headerMap.getOrPut(HEADER_COMMENT) { mutableSetOf() }
.add(it.replace("\n", "\\n").replace("\r", "\\r"))
headerMap.getOrPut(HEADER_COMMENT) { mutableSetOf() }.add(it)
}
// X-1 further identities
when (userIds.size) {

View file

@ -11,9 +11,14 @@ import org.bouncycastle.util.Arrays
*
* @param chars may be null for empty passwords.
*/
class Passphrase(private val chars: CharArray?) {
class Passphrase(chars: CharArray?) {
private val lock = Any()
private var valid = true
private val chars: CharArray?
init {
this.chars = trimWhitespace(chars)
}
/**
* Return a copy of the underlying char array. A return value of null represents an empty
@ -62,13 +67,6 @@ class Passphrase(private val chars: CharArray?) {
override fun hashCode(): Int = getChars()?.let { String(it) }.hashCode()
/**
* Return a copy of this [Passphrase], but with whitespace characters trimmed off.
*
* @return copy with trimmed whitespace
*/
fun withTrimmedWhitespace(): Passphrase = Passphrase(trimWhitespace(chars))
companion object {
/**

View file

@ -100,14 +100,4 @@ public class GenerateKeyTest {
assertThrows(SOPGPException.UnsupportedProfile.class, () ->
sop.generateKey().profile("invalid"));
}
@Test
public void generateKeyWithNewlinesInUserId() throws IOException {
byte[] keyBytes = sop.generateKey()
.userId("Foo\n\nBar")
.generate()
.getBytes();
assertTrue(new String(keyBytes).contains("Foo\\n\\nBar"));
}
}