summaryrefslogtreecommitdiff
path: root/openssl/src/cms.rs
diff options
context:
space:
mode:
authorDaniel Abramov <dabramov@snapview.de>2019-06-12 15:10:05 +0200
committerDaniel Abramov <dabramov@snapview.de>2019-06-12 16:48:16 +0200
commitfab6ea4727dd70c36989f21d41ef21793eaa4006 (patch)
tree196932e3235fd59a256607737f417001369b0313 /openssl/src/cms.rs
parented966a09ac723c0437f7ab1e6a1a7527b1461307 (diff)
downloadrust-openssl-fab6ea4727dd70c36989f21d41ef21793eaa4006.zip
Conditionally compile PEM functions for CMS
Apparently libressl does not quite support all CMS functions (well, at least the bindings for CMS are currently compile-time guarded), so CI checks inside the systest fail during the verification on libressl. This is an attempt to fix it.
Diffstat (limited to 'openssl/src/cms.rs')
-rw-r--r--openssl/src/cms.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/openssl/src/cms.rs b/openssl/src/cms.rs
index fb5d627b..21af2a80 100644
--- a/openssl/src/cms.rs
+++ b/openssl/src/cms.rs
@@ -248,11 +248,10 @@ mod test {
let encrypt = CmsContentInfo::encrypt(&cert_stack, &input.as_bytes(), Cipher::des_ede3_cbc(), CMSOptions::empty())
.expect("failed create encrypted cms");
- let encrypted_der = encrypt.to_der().expect("failed to create der from cms");
- let encrypted_pem = encrypt.to_pem().expect("failed to create pem from cms");
// decrypt cms message using private key cert (DER)
{
+ let encrypted_der = encrypt.to_der().expect("failed to create der from cms");
let decrypt = CmsContentInfo::from_der(&encrypted_der).expect("failed read cms from der");
let decrypt = decrypt.decrypt(&priv_cert.pkey, &priv_cert.cert).expect("failed to decrypt cms");
let decrypt = String::from_utf8(decrypt).expect("failed to create string from cms content");
@@ -261,6 +260,7 @@ mod test {
// decrypt cms message using private key cert (PEM)
{
+ let encrypted_pem = encrypt.to_pem().expect("failed to create pem from cms");
let decrypt = CmsContentInfo::from_pem(&encrypted_pem).expect("failed read cms from pem");
let decrypt = decrypt.decrypt(&priv_cert.pkey, &priv_cert.cert).expect("failed to decrypt cms");
let decrypt = String::from_utf8(decrypt).expect("failed to create string from cms content");