Lines Matching defs:exc
907 SSL_EXCERT *exc = arg;
921 if (exc == NULL)
928 while (exc->next != NULL)
929 exc = exc->next;
933 while (exc != NULL) {
935 rv = SSL_check_chain(ssl, exc->cert, exc->key, exc->chain);
937 X509_NAME_print_ex(bio_err, X509_get_subject_name(exc->cert), 0,
942 if (!SSL_use_certificate(ssl, exc->cert)
943 || !SSL_use_PrivateKey(ssl, exc->key)) {
951 if (exc->build_chain) {
954 } else if (exc->chain != NULL) {
955 if (!SSL_set1_chain(ssl, exc->chain))
959 exc = exc->prev;
964 void ssl_ctx_set_excert(SSL_CTX *ctx, SSL_EXCERT *exc)
966 SSL_CTX_set_cert_cb(ctx, set_cert_cb, exc);
971 SSL_EXCERT *exc = app_malloc(sizeof(*exc), "prepend cert");
973 memset(exc, 0, sizeof(*exc));
975 exc->next = *pexc;
976 *pexc = exc;
978 if (exc->next) {
979 exc->certform = exc->next->certform;
980 exc->keyform = exc->next->keyform;
981 exc->next->prev = exc;
983 exc->certform = FORMAT_PEM;
984 exc->keyform = FORMAT_PEM;
990 void ssl_excert_free(SSL_EXCERT *exc)
994 if (exc == NULL)
996 while (exc) {
997 X509_free(exc->cert);
998 EVP_PKEY_free(exc->key);
999 sk_X509_pop_free(exc->chain, X509_free);
1000 curr = exc;
1001 exc = exc->next;
1008 SSL_EXCERT *exc = *pexc;
1010 if (exc == NULL)
1013 if (exc->certfile == NULL && exc->next == NULL) {
1014 ssl_excert_free(exc);
1018 for (; exc; exc = exc->next) {
1019 if (exc->certfile == NULL) {
1023 exc->cert = load_cert(exc->certfile, exc->certform,
1025 if (exc->cert == NULL)
1027 if (exc->keyfile != NULL) {
1028 exc->key = load_key(exc->keyfile, exc->keyform,
1031 exc->key = load_key(exc->certfile, exc->certform,
1034 if (exc->key == NULL)
1036 if (exc->chainfile != NULL) {
1037 if (!load_certs(exc->chainfile, 0, &exc->chain, NULL, "server chain"))
1048 SSL_EXCERT *exc = *pexc;
1053 if (exc == NULL) {
1054 if (!ssl_excert_prepend(&exc)) {
1059 *pexc = exc;
1067 if (exc->certfile != NULL && !ssl_excert_prepend(&exc)) {
1071 *pexc = exc;
1072 exc->certfile = opt_arg();
1075 if (exc->keyfile != NULL) {
1079 exc->keyfile = opt_arg();
1082 if (exc->chainfile != NULL) {
1087 exc->chainfile = opt_arg();
1090 exc->build_chain = 1;
1093 if (!opt_format(opt_arg(), OPT_FMT_ANY, &exc->certform))
1097 if (!opt_format(opt_arg(), OPT_FMT_ANY, &exc->keyform))
1105 ssl_excert_free(exc);