@@ -11,24 +11,7 @@ import (
11
11
// Default returns a custom profile that support features
12
12
// that are widely implemented.
13
13
func Default () * Custom {
14
- setKeyAlgorithm := func (cfg * packet.Config , securityLevel int8 ) {
15
- cfg .Algorithm = packet .PubKeyAlgoEdDSA
16
- switch securityLevel {
17
- case constants .HighSecurity :
18
- cfg .Curve = packet .Curve25519
19
- default :
20
- cfg .Curve = packet .Curve25519
21
- }
22
- }
23
- return & Custom {
24
- SetKeyAlgorithm : setKeyAlgorithm ,
25
- Hash : crypto .SHA256 ,
26
- CipherEncryption : packet .CipherAES256 ,
27
- CompressionAlgorithm : packet .CompressionZLIB ,
28
- CompressionConfiguration : & packet.CompressionConfig {
29
- Level : 6 ,
30
- },
31
- }
14
+ return ProtonV1 ()
32
15
}
33
16
34
17
// RFC4880 returns a custom profile for this library
@@ -142,3 +125,34 @@ func Symmetric() *Custom {
142
125
V6 : true ,
143
126
}
144
127
}
128
+
129
+ // ProtonV1 is the version 1 profile used in proton clients.
130
+ func ProtonV1 () * Custom {
131
+ setKeyAlgorithm := func (cfg * packet.Config , securityLevel int8 ) {
132
+ cfg .Algorithm = packet .PubKeyAlgoEdDSA
133
+ switch securityLevel {
134
+ case constants .HighSecurity :
135
+ cfg .Curve = packet .Curve25519
136
+ default :
137
+ cfg .Curve = packet .Curve25519
138
+ }
139
+ }
140
+ return & Custom {
141
+ SetKeyAlgorithm : setKeyAlgorithm ,
142
+ Hash : crypto .SHA512 ,
143
+ CipherEncryption : packet .CipherAES256 ,
144
+ CipherKeyEncryption : packet .CipherAES256 ,
145
+ CompressionAlgorithm : packet .CompressionZLIB ,
146
+ CompressionConfiguration : & packet.CompressionConfig {
147
+ Level : 6 ,
148
+ },
149
+ S2kKeyEncryption : & s2k.Config {
150
+ S2KMode : s2k .IteratedSaltedS2K ,
151
+ Hash : crypto .SHA256 ,
152
+ S2KCount : 65536 ,
153
+ },
154
+ DisableIntendedRecipients : true ,
155
+ AllowAllPublicKeyAlgorithms : true ,
156
+ AllowWeakRSA : true ,
157
+ }
158
+ }
0 commit comments