gnutls_session_t state;
char portname[6];
socket_st hd;
- const char *app_proto = NULL;
+ char app_proto[32] = "";
cmd_parser(argc, argv);
#endif
if (HAVE_OPT(APP_PROTO)) {
- app_proto = OPT_ARG(APP_PROTO);
+ snprintf(app_proto, sizeof(app_proto), "%s", OPT_ARG(APP_PROTO));
}
if (app_proto == NULL) {
- app_proto = port_to_service(portname, "tcp");
+ snprintf(app_proto, sizeof(app_proto), "%s", port_to_service(portname, "tcp"));
}
sockets_init();
int resume, starttls, insecure, ranges, rehandshake, udp, mtu,
inline_commands;
const char *hostname = NULL;
-const char *service = NULL;
+char service[32]="";
int record_max_size;
int fingerprint;
int crlf;
mtu = OPT_VALUE_MTU;
if (HAVE_OPT(PORT)) {
- service = OPT_ARG(PORT);
+ snprintf(service, sizeof(service), "%s", OPT_ARG(PORT));
} else {
if (HAVE_OPT(STARTTLS_PROTO))
- service = starttls_proto_to_service(OPT_ARG(STARTTLS_PROTO));
+ snprintf(service, sizeof(service), "%s", starttls_proto_to_service(OPT_ARG(STARTTLS_PROTO)));
else
- service = "443";
+ strcpy(service, "443");
}
record_max_size = OPT_VALUE_RECORDSIZE;
$ danetool --check www.example.com --proto tcp --port 443
@end example
-To verify a server's DANE TLSA entry, use:
+To verify an HTTPS server's DANE TLSA entry, use:
@example
$ danetool --check www.example.com --proto tcp --port 443 --load-certificate chain.pem
+
+To verify an SMTP server's DANE TLSA entry, use:
+@example
+$ danetool --check www.example.com --proto tcp --starttls-proto=smtp --load-certificate chain.pem
@end example
_EOT_;
};
int ret, privkey_op = 0;
common_info_st cinfo;
const char *proto = "tcp";
- const char *service = "443";
+ char service[32] = "443";
optionProcess(&danetoolOptions, argc, argv);
cinfo.cert = OPT_ARG(LOAD_CERTIFICATE);
if (HAVE_OPT(PORT)) {
- service = OPT_ARG(PORT);
+ snprintf(service, sizeof(service), "%s", OPT_ARG(PORT));
} else {
if (HAVE_OPT(STARTTLS_PROTO))
- service = starttls_proto_to_service(OPT_ARG(STARTTLS_PROTO));
+ snprintf(service, sizeof(service), "%s", starttls_proto_to_service(OPT_ARG(STARTTLS_PROTO)));
}
if (HAVE_OPT(PROTO))