- if (!reqfile && !newcert) { /* certificate should be self-signed */
- X509_STORE_CTX *xsc = X509_STORE_CTX_new();
-
- if (xsc == NULL || !X509_STORE_CTX_init(xsc, ctx, x, NULL)) {
- BIO_printf(bio_err, "Error initialising X509 store\n");
- X509_STORE_CTX_free(xsc);
- goto end;
- }
- X509_STORE_CTX_set_cert(xsc, x);
- X509_STORE_CTX_set_flags(xsc, X509_V_FLAG_CHECK_SS_SIGNATURE);
- i = X509_verify_cert(xsc);
- X509_STORE_CTX_free(xsc);
- if (i <= 0)
- goto end;
- }