int i;
X509 *newcert = NULL;
ENGINE *engine = NULL;
- OSSL_CMP_CTX *srv_cmp_ctx = NULL;
int ret = 0; /* default: failure */
if (!handle_opts_upfront(argc, argv))
goto err;
}
}
+
if (opt_server != NULL && opt_use_mock_srv) {
CMP_err("cannot use both -server and -use_mock_srv options");
goto err;
}
+ if ((opt_server == NULL || opt_use_mock_srv) && opt_tls_used) {
+ CMP_warn("ignoring -tls_used option since -server is not given or -use_mock_srv is given");
+ opt_tls_used = 0;
+ }
+
#endif
if (opt_ignore_keyusage)
#endif
)) {
OSSL_CMP_SRV_CTX *srv_ctx;
+ OSSL_CMP_CTX *srv_cmp_ctx;
if ((srv_ctx = setup_srv_ctx(engine)) == NULL)
goto err;
goto err;
}
OSSL_CMP_CTX_set_log_verbosity(srv_cmp_ctx, opt_verbosity);
- }
#if !defined(OPENSSL_NO_SOCK) && !defined(OPENSSL_NO_HTTP)
- if (opt_tls_used && (opt_use_mock_srv || opt_server == NULL)) {
- CMP_warn("ignoring -tls_used option since -use_mock_srv is given or -server is not given");
- opt_tls_used = 0;
- }
-
- if (opt_port != NULL) { /* act as very basic CMP HTTP server */
- ret = cmp_server(srv_cmp_ctx);
- goto err;
+ if (opt_port != NULL) { /* act as very basic CMP HTTP server only */
+ ret = cmp_server(srv_cmp_ctx);
+ goto err;
+ }
+#endif
}
/* act as CMP client, possibly using internal mock server */
if (opt_reqout_only != NULL) {
const char *msg = "option is ignored since -reqout_only option is given";
-# if !defined(OPENSSL_NO_SOCK) && !defined(OPENSSL_NO_HTTP)
+#if !defined(OPENSSL_NO_SOCK) && !defined(OPENSSL_NO_HTTP)
+ if (opt_port != NULL) {
+ CMP_err("the -reqout_only client option does not combine with -port implying server behavior");
+ goto err;
+ }
if (opt_server != NULL)
CMP_warn1("-server %s", msg);
-# endif
+#endif
if (opt_use_mock_srv)
CMP_warn1("-use_mock_srv %s", msg);
if (opt_reqout != NULL)
opt_reqout = opt_reqout_only;
}
if (opt_rspin != NULL) {
+#if !defined(OPENSSL_NO_SOCK) && !defined(OPENSSL_NO_HTTP)
if (opt_server != NULL)
CMP_warn("-server option is not used if enough filenames given for -rspin");
+#endif
if (opt_use_mock_srv)
CMP_warn("-use_mock_srv option is not used if enough filenames given for -rspin");
}
-#endif
if (!setup_client_ctx(cmp_ctx, engine)) {
CMP_err("cannot set up CMP context");
1,rspin, -section,, -cmd,ir,,BLANK,,,-rspin,_RESULT_DIR/ip.der _RESULT_DIR/pkiConf.der,,BLANK,,BLANK
0,rspin too few files - server must reject, -section,, -cmd,ir,,BLANK,,,-rspin,_RESULT_DIR/ip.der,,BLANK,,BLANK,-secret,_PBM_SECRET
0,rspin too few files - no server, -section,, -cmd,ir,,BLANK,,,-rspin,_RESULT_DIR/ip.der,,BLANK,,BLANK, -server,""""
+0,reqout_only ir with -port, -section,, -cmd,ir,,-reqout_only,_RESULT_DIR/ir1.der,,BLANK,,BLANK, -server,"""", -port,0
1,reqout_only ir - no server, -section,, -cmd,ir,,-reqout_only,_RESULT_DIR/ir2.der,,BLANK,,BLANK, -server,""""
0,reqout_only non-existing directory and file, -section,, -cmd,ir,,-reqout_only,idontexist/idontexist,,BLANK,,BLANK, -server,""""
0,reqin ir - no newkey, -section,, -cmd,ir,,-reqin,_RESULT_DIR/ir2.der,,-newkey,"""",-newkey,"""",-key,"""",-cert,"""",-secret,_PBM_SECRET