typo
[openssl.git] / demos / cms / cms_dec.c
index 29de15dfd62a69a8949e12ab079027462f1dca58..9fee0a3ebfc4d519e5eadf3a3bd4967ab1802153 100644 (file)
@@ -1,4 +1,4 @@
-/* Simple S/MIME signing example */
+/* Simple S/MIME decryption example */
 #include <openssl/pem.h>
 #include <openssl/cms.h>
 #include <openssl/err.h>
@@ -29,25 +29,25 @@ int main(int argc, char **argv)
        if (!rcert || !rkey)
                goto err;
 
-       /* Open content being signed */
+       /* Open S/MIME message to decrypt */
 
        in = BIO_new_file("smencr.txt", "r");
 
        if (!in)
                goto err;
 
-       /* Sign content */
+       /* Parse message */
        cms = SMIME_read_CMS(in, NULL);
 
        if (!cms)
                goto err;
 
-       out = BIO_new_file("encrout.txt", "w");
+       out = BIO_new_file("decout.txt", "w");
        if (!out)
                goto err;
 
        /* Decrypt S/MIME message */
-       if (!CMS_decrypt(cms, rkey, rcert, out, NULL, 0))
+       if (!CMS_decrypt(cms, rkey, rcert, NULL, out, 0))
                goto err;
 
        ret = 0;
@@ -56,7 +56,7 @@ int main(int argc, char **argv)
 
        if (ret)
                {
-               fprintf(stderr, "Error Signing Data\n");
+               fprintf(stderr, "Error Decrypting Data\n");
                ERR_print_errors_fp(stderr);
                }
 
@@ -77,7 +77,3 @@ int main(int argc, char **argv)
        return ret;
 
        }
-
-
-
-