session_id_prefix = opt_arg();
break;
case OPT_ENGINE:
- engine_id = opt_arg();
+ e = setup_engine(opt_arg(), 1);
break;
case OPT_RAND:
inrand = opt_arg();
}
#endif
-#ifndef OPENSSL_NO_ENGINE
- e = setup_engine(engine_id, 1);
-#endif
-
if (!app_passwd(passarg, dpassarg, &pass, &dpass)) {
BIO_printf(bio_err, "Error getting password\n");
goto end;
/* BIO_puts(io,SSLeay_version(SSLEAY_VERSION));*/
BIO_puts(io, "\n");
for (i = 0; i < local_argc; i++) {
- BIO_puts(io, local_argv[i]);
+ const char *myp;
+ for (myp = local_argv[i]; *myp; myp++)
+ switch (*myp) {
+ case '<':
+ BIO_puts(io, "<");
+ break;
+ case '>':
+ BIO_puts(io, ">");
+ break;
+ case '&':
+ BIO_puts(io, "&");
+ break;
+ default:
+ BIO_write(io, myp, 1);
+ break;
+ }
BIO_write(io, " ", 1);
}
BIO_puts(io, "\n");
sess->derlen = i2d_SSL_SESSION(session, NULL);
if (sess->derlen < 0) {
BIO_printf(bio_err, "Error encoding session\n");
+ OPENSSL_free(sess);
return 0;
}
sess->der = OPENSSL_malloc(sess->derlen);
if (!sess->id || !sess->der) {
BIO_printf(bio_err, "Out of memory adding to external cache\n");
- if (sess->id)
- OPENSSL_free(sess->id);
- if (sess->der)
- OPENSSL_free(sess->der);
+ OPENSSL_free(sess->id);
+ OPENSSL_free(sess->der);
OPENSSL_free(sess);
return 0;
}
/* Assume it still works. */
if (i2d_SSL_SESSION(session, &p) != sess->derlen) {
- BIO_printf(bio_err, "Error encoding session\n");
+ BIO_printf(bio_err, "Re-encoding session strangeness\n");
+ OPENSSL_free(sess->id);
+ OPENSSL_free(sess->der);
+ OPENSSL_free(sess);
return 0;
}