#include <stdio.h>#include <string.h>#include "apps.h"#include <openssl/crypto.h>#include <openssl/pem.h>#include <openssl/err.h>#include <openssl/x509_vfy.h>#include <openssl/x509v3.h>Go to the source code of this file.
Defines | |
| #define | PROG smime_main |
| #define | SMIME_OP 0x10 |
| #define | SMIME_ENCRYPT (1 | SMIME_OP) |
| #define | SMIME_DECRYPT 2 |
| #define | SMIME_SIGN (3 | SMIME_OP) |
| #define | SMIME_VERIFY 4 |
| #define | SMIME_PK7OUT 5 |
Functions | |
| static int | save_certs (char *signerfile, STACK_OF(X509)*signers) |
| static int | smime_cb (int ok, X509_STORE_CTX *ctx) |
| int | MAIN (int, char **) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||
|
Definition at line 757 of file smime.c. References BIO_free(), BIO_new_file(), sk_X509_num, and sk_X509_value. 00758 { 00759 int i; 00760 BIO *tmp; 00761 if (!signerfile) 00762 return 1; 00763 tmp = BIO_new_file(signerfile, "w"); 00764 if (!tmp) return 0; 00765 for(i = 0; i < sk_X509_num(signers); i++) 00766 PEM_write_bio_X509(tmp, sk_X509_value(signers, i)); 00767 BIO_free(tmp); 00768 return 1; 00769 }
|
|
||||||||||||
|
Definition at line 774 of file smime.c. References error, policies_print(), X509_STORE_CTX_get_error(), X509_V_ERR_NO_EXPLICIT_POLICY, and X509_V_OK. 00775 { 00776 int error; 00777 00778 error = X509_STORE_CTX_get_error(ctx); 00779 00780 if ((error != X509_V_ERR_NO_EXPLICIT_POLICY) 00781 && ((error != X509_V_OK) || (ok != 2))) 00782 return ok; 00783 00784 policies_print(NULL, ctx); 00785 00786 return ok; 00787 00788 }
|