signal(SIGTERM, dropcarr); /* Cleanup gracefully if terminated */
signal(SIGCONT, catch_sigcont); /* Catch SIGCONT so we can reset terminal */
+#ifdef HAVE_OPENSSL
arg_encrypt = RC_DEFAULT;
+#endif
#ifdef HAVE_CURSES_H
arg_screen = RC_DEFAULT;
#endif
argc = shift(argc, argv, a, 2);
}
if (!strcmp(argv[a], "-x")) {
+#ifdef HAVE_OPENSSL
arg_encrypt = RC_NO;
+#endif
argc = shift(argc, argv, a, 1);
}
if (!strcmp(argv[a], "-X")) {
+#ifdef HAVE_OPENSSL
arg_encrypt = RC_YES;
- argc = shift(argc, argv, a, 1);
+ argc = shift(argc, argv, a, 1);
+#else
+ fprintf(stderr, "Not compiled with encryption support");
+ return 1;
+#endif
}
if (!strcmp(argv[a], "-s")) {
#ifdef HAVE_CURSES_H
serv_gets(aaa);
if (nonce[0])
{
- sprintf(aaa, "PAS2 %s", make_apop_string(password, nonce, hexstring));
+ snprintf(aaa, sizeof aaa, "PAS2 %s", make_apop_string(password, nonce, hexstring, sizeof hexstring));
}
else /* Else no APOP */
{
if (nonce[0])
{
- sprintf(aaa, "PAS2 %s", make_apop_string(password, nonce, hexstring));
+ snprintf(aaa, sizeof aaa, "PAS2 %s", make_apop_string(password, nonce, hexstring, sizeof hexstring));
}
else /* Else no APOP */
{
- snprintf(aaa, sizeof(aaa)-1, "PASS %s", password);
+ snprintf(aaa, sizeof aaa, "PASS %s", password);
}
serv_puts(aaa);