diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2008-03-14 23:30:56 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2008-03-14 23:30:56 +0000 |
commit | d9f5f07e286bfc7a2a81756199a3e94444e0f6ce (patch) | |
tree | 958d67c1dde917f30716dc49cb8405dbae6a89bb /apps | |
parent | b31db9ee96c76c964085c09768b3c10cca0c807f (diff) |
Initial support for Encrypted Data type generation.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/cms.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/cms.c b/apps/cms.c index ea538576a3..29e43999e2 100644 --- a/apps/cms.c +++ b/apps/cms.c @@ -87,6 +87,7 @@ static int smime_cb(int ok, X509_STORE_CTX *ctx); #define SMIME_UNCOMPRESS (11 | SMIME_IP) #define SMIME_COMPRESS (12 | SMIME_OP) #define SMIME_ENCRYPTED_DECRYPT (13 | SMIME_IP) +#define SMIME_ENCRYPTED_ENCRYPT (14 | SMIME_OP) int MAIN(int, char **); @@ -169,6 +170,8 @@ int MAIN(int argc, char **argv) operation = SMIME_UNCOMPRESS; else if (!strcmp (*args, "-EncryptedData_decrypt")) operation = SMIME_ENCRYPTED_DECRYPT; + else if (!strcmp (*args, "-EncryptedData_encrypt")) + operation = SMIME_ENCRYPTED_ENCRYPT; #ifndef OPENSSL_NO_DES else if (!strcmp (*args, "-des3")) cipher = EVP_des_ede3_cbc(); @@ -745,6 +748,14 @@ int MAIN(int argc, char **argv) flags |= CMS_STREAM; cms = CMS_encrypt(encerts, in, cipher, flags); } + else if (operation == SMIME_ENCRYPTED_ENCRYPT) + { + if (indef) + flags |= CMS_STREAM; + cms = CMS_EncryptedData_encrypt(in, cipher, + secret_key, secret_keylen, + flags); + } else if (operation & SMIME_SIGNERS) { int i; |