summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Michaelis <kai@sequoia-pgp.org>2019-02-15 20:05:34 +0100
committerKai Michaelis <kai@sequoia-pgp.org>2019-02-15 20:05:34 +0100
commit3f050579321c6805c9c6c231310a2efd517ee959 (patch)
treec98f73ef2d7c2d7374290740c607fad6054474c9
parenta51f9254b69105485c8eee7d55da080a65925ab7 (diff)
openpgp: fix TPKBuilder comments, add test for all suites
-rw-r--r--openpgp/src/tpk/builder.rs15
1 files changed, 13 insertions, 2 deletions
diff --git a/openpgp/src/tpk/builder.rs b/openpgp/src/tpk/builder.rs
index 502763ee..3a354c66 100644
--- a/openpgp/src/tpk/builder.rs
+++ b/openpgp/src/tpk/builder.rs
@@ -26,9 +26,9 @@ pub enum CipherSuite {
Cv25519,
/// 3072 bit RSA with SHA512 and AES256
RSA3k,
- /// EdDSA and ECDH over NIST P-256 with SHA512 and AES256
+ /// EdDSA and ECDH over NIST P-256 with SHA256 and AES256
P256,
- /// EdDSA and ECDH over NIST P-384 with SHA512 and AES256
+ /// EdDSA and ECDH over NIST P-384 with SHA384 and AES256
P384,
/// EdDSA and ECDH over NIST P-521 with SHA512 and AES256
P521,
@@ -591,4 +591,15 @@ mod tests {
.generate().unwrap();
assert!(tpk.primary().secret().unwrap().is_encrypted());
}
+
+ #[test]
+ fn all_ciphersuites() {
+ use self::CipherSuite::*;
+
+ for cs in vec![Cv25519, RSA3k, P256, P384, P521] {
+ assert!(TPKBuilder::default()
+ .set_cipher_suite(cs)
+ .generate().is_ok());
+ }
+ }
}