Generate keys with compression & release 2.2.3
This commit is contained in:
parent
88d66965eb
commit
64c051f0d9
5 changed files with 27 additions and 7 deletions
|
|
@ -439,11 +439,12 @@ func generateKey(
|
|||
comments := ""
|
||||
|
||||
cfg := &packet.Config{
|
||||
Algorithm: packet.PubKeyAlgoRSA,
|
||||
RSABits: bits,
|
||||
Time: getKeyGenerationTimeGenerator(),
|
||||
DefaultHash: crypto.SHA256,
|
||||
DefaultCipher: packet.CipherAES256,
|
||||
Algorithm: packet.PubKeyAlgoRSA,
|
||||
RSABits: bits,
|
||||
Time: getKeyGenerationTimeGenerator(),
|
||||
DefaultHash: crypto.SHA256,
|
||||
DefaultCipher: packet.CipherAES256,
|
||||
DefaultCompressionAlgo: packet.CompressionZLIB,
|
||||
}
|
||||
|
||||
if keyType == "x25519" {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import (
|
|||
|
||||
"github.com/ProtonMail/go-crypto/openpgp"
|
||||
"github.com/ProtonMail/go-crypto/openpgp/armor"
|
||||
"github.com/ProtonMail/go-crypto/openpgp/packet"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
|
@ -426,3 +427,11 @@ func TestUnlockMismatchingKey(t *testing.T) {
|
|||
t.Fatalf("Mismatching private key was not detected")
|
||||
}
|
||||
}
|
||||
|
||||
func TestKeyCompression(t *testing.T) {
|
||||
assert.Equal(
|
||||
t,
|
||||
[]uint8{uint8(packet.CompressionNone), uint8(packet.CompressionZLIB)},
|
||||
keyTestEC.entity.PrimaryIdentity().SelfSignature.PreferredCompression,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue