(void)i2d_X509_bio(bp, x);
return;
}
-#if 0
- /* ??? Not needed since X509_print prints all this stuff anyway */
- f = X509_NAME_oneline(X509_get_issuer_name(x), buf, 256);
- BIO_printf(bp, "issuer :%s\n", f);
-
- f = X509_NAME_oneline(X509_get_subject_name(x), buf, 256);
- BIO_printf(bp, "subject:%s\n", f);
-
- BIO_puts(bp, "serial :");
- i2a_ASN1_INTEGER(bp, x->cert_info->serialNumber);
- BIO_puts(bp, "\n\n");
-#endif
if (!notext)
X509_print(bp, x);
PEM_write_bio_X509(bp, x);
if (!ENGINE_ctrl(e, ENGINE_CTRL_HAS_CTRL_FUNCTION, 0, NULL, NULL) ||
((num = ENGINE_ctrl(e, ENGINE_CTRL_GET_FIRST_CMD_TYPE,
0, NULL, NULL)) <= 0)) {
-# if 0
- BIO_printf(bio_out, "%s<no control commands>\n", indent);
-# endif
return 1;
}
}
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
-#if 0
- if (getenv("OPENSSL_DEBUG_LOCKING") != NULL)
-#endif
- {
- CRYPTO_set_locking_callback(lock_dbg_cb);
- }
+ CRYPTO_set_locking_callback(lock_dbg_cb);
if (getenv("OPENSSL_FIPS")) {
#ifdef OPENSSL_FIPS
BIO_printf(bio, " ");
num = len;
-#if 0
- if (num > 16)
- num = 16;
-#endif
for (i = 0; i < num; i++) {
if (i % 16 == 0 && i > 0)
BIO_printf(bio, "\n ");
if (state)
SSL_CTX_set_info_callback(ctx, apps_ssl_info_callback);
-#if 0
- else
- SSL_CTX_set_cipher_list(ctx, getenv("SSL_CIPHER"));
-#endif
SSL_CTX_set_verify(ctx, verify, verify_callback);
SSL_set_tlsext_status_type(con, TLSEXT_STATUSTYPE_ocsp);
SSL_CTX_set_tlsext_status_cb(ctx, ocsp_resp_cb);
SSL_CTX_set_tlsext_status_arg(ctx, bio_c_out);
-# if 0
- {
- STACK_OF(OCSP_RESPID) *ids = sk_OCSP_RESPID_new_null();
- OCSP_RESPID *id = OCSP_RESPID_new();
- id->value.byKey = ASN1_OCTET_STRING_new();
- id->type = V_OCSP_RESPID_KEY;
- ASN1_STRING_set(id->value.byKey, "Hello World", -1);
- sk_OCSP_RESPID_push(ids, id);
- SSL_set_tlsext_status_ids(con, ids);
- }
-# endif
}
#endif
#ifndef OPENSSL_NO_JPAKE
tty_on = 1;
if (in_init) {
in_init = 0;
-#if 0 /* This test doesn't really work as intended
- * (needs to be fixed) */
-# ifndef OPENSSL_NO_TLSEXT
- if (servername != NULL && !SSL_session_reused(con)) {
- BIO_printf(bio_c_out,
- "Server did %sacknowledge servername extension.\n",
- tlsextcbp.ack ? "" : "not ");
- }
-# endif
-#endif
if (sess_out) {
BIO *stmp = BIO_new_file(sess_out, "w");
if (stmp) {
STACK_OF(X509_EXTENSION) *exts;
int ret = SSL_TLSEXT_ERR_NOACK;
int i;
-# if 0
- STACK_OF(OCSP_RESPID) *ids;
- SSL_get_tlsext_status_ids(s, &ids);
- BIO_printf(err, "cert_status: received %d ids\n",
- sk_OCSP_RESPID_num(ids));
-# endif
if (srctx->verbose)
BIO_puts(err, "cert_status: callback called\n");
/* Build up OCSP query from server certificate */
SSL_CTX_set_tlsext_use_srtp(ctx, srtp_profiles);
#endif
-#if 0
- if (cipher == NULL)
- cipher = getenv("SSL_CIPHER");
-#endif
-
-#if 0
- if (s_cert_file == NULL) {
- BIO_printf(bio_err,
- "You must specify a certificate file for the server to use\n");
- goto end;
- }
-#endif
-
if ((!SSL_CTX_load_verify_locations(ctx, CAfile, CApath)) ||
(!SSL_CTX_set_default_verify_paths(ctx))) {
/* BIO_printf(bio_err,"X509_load_verify_locations\n"); */
}
#endif
-#if 0
-static int load_CA(SSL_CTX *ctx, char *file)
-{
- FILE *in;
- X509 *x = NULL;
-
- if ((in = fopen(file, "r")) == NULL)
- return (0);
-
- for (;;) {
- if (PEM_read_X509(in, &x, NULL) == NULL)
- break;
- SSL_CTX_add_client_CA(ctx, x);
- }
- if (x != NULL)
- X509_free(x);
- fclose(in);
- return (1);
-}
-#endif
-
static int www_body(char *hostname, int s, int stype, unsigned char *context)
{
char *buf = NULL;
BIO_printf(io, "'%s' is an invalid path\r\n", p);
break;
}
-#if 0
- /* append if a directory lookup */
- if (e[-1] == '/')
- strcat(p, "index.html");
-#endif
/* if a directory, do the index thang */
if (app_isdir(p) > 0) {
-#if 0 /* must check buffer size */
- strcat(p, "/index.html");
-#else
BIO_puts(io, text);
BIO_printf(io, "'%s' is a directory\r\n", p);
break;
-#endif
}
if ((file = BIO_new_file(p, "r")) == NULL) {
goto bad;
host = *(++argv);
}
-#if 0
- else if (strcmp(*argv, "-host") == 0) {
- if (--argc < 1)
- goto bad;
- host = *(++argv);
- } else if (strcmp(*argv, "-port") == 0) {
- if (--argc < 1)
- goto bad;
- port = *(++argv);
- }
-#endif
else if (strcmp(*argv, "-reuse") == 0)
perform = 2;
else if (strcmp(*argv, "-new") == 0)
SSL_set_bio(serverCon, conn, conn);
-#if 0
- if (scon != NULL)
- SSL_set_session(serverCon, SSL_get_session(scon));
-#endif
-
/* ok, lets connect */
for (;;) {
i = SSL_connect(serverCon);
while (*args) {
if (!(cert = load_cert(bio_err, *args, FORMAT_PEM,
NULL, e, "recipient certificate file"))) {
-#if 0 /* An appropriate message is already printed */
- BIO_printf(bio_err,
- "Can't read recipient certificate file %s\n",
- *args);
-#endif
goto end;
}
sk_X509_push(encerts, cert);
else
#endif
#ifndef OPENSSL_NO_RSA
-# if 0 /* was: #ifdef RSAref */
- if (strcmp(*argv, "rsaref") == 0) {
- RSA_set_default_openssl_method(RSA_PKCS1_RSAref());
- j--;
- } else
-# endif
# ifndef RSA_NULL
if (strcmp(*argv, "openssl") == 0) {
RSA_set_default_method(RSA_PKCS1_SSLeay());
i);
goto end;
}
-# if 0
- else {
- BIO_printf(bio_err,
- mr ? "+RK:%d:"
- : "Loaded RSA key, %d bit modulus and e= 0x",
- BN_num_bits(rsa_key[i]->n));
- BN_print(bio_err, rsa_key[i]->e);
- BIO_printf(bio_err, "\n");
- }
-# endif
}
#endif