summaryrefslogtreecommitdiff
path: root/sshconnect.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshconnect.c')
-rw-r--r--sshconnect.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/sshconnect.c b/sshconnect.c
index 33d9c727f..32bef7d07 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -13,7 +13,7 @@
13 */ 13 */
14 14
15#include "includes.h" 15#include "includes.h"
16RCSID("$OpenBSD: sshconnect.c,v 1.139 2003/04/14 14:17:50 markus Exp $"); 16RCSID("$OpenBSD: sshconnect.c,v 1.140 2003/05/14 18:16:21 jakob Exp $");
17 17
18#include <openssl/bn.h> 18#include <openssl/bn.h>
19 19
@@ -33,6 +33,10 @@ RCSID("$OpenBSD: sshconnect.c,v 1.139 2003/04/14 14:17:50 markus Exp $");
33#include "misc.h" 33#include "misc.h"
34#include "readpass.h" 34#include "readpass.h"
35 35
36#ifdef DNS
37#include "dns.h"
38#endif
39
36char *client_version_string = NULL; 40char *client_version_string = NULL;
37char *server_version_string = NULL; 41char *server_version_string = NULL;
38 42
@@ -797,11 +801,28 @@ fail:
797 return -1; 801 return -1;
798} 802}
799 803
804/* returns 0 if key verifies or -1 if key does NOT verify */
800int 805int
801verify_host_key(char *host, struct sockaddr *hostaddr, Key *host_key) 806verify_host_key(char *host, struct sockaddr *hostaddr, Key *host_key)
802{ 807{
803 struct stat st; 808 struct stat st;
804 809
810#ifdef DNS
811 if (options.verify_host_key_dns) {
812 switch(verify_host_key_dns(host, hostaddr, host_key)) {
813 case DNS_VERIFY_OK:
814 return 0;
815 case DNS_VERIFY_FAILED:
816 return -1;
817 case DNS_VERIFY_ERROR:
818 break;
819 default:
820 debug3("bad return value from verify_host_key_dns");
821 break;
822 }
823 }
824#endif /* DNS */
825
805 /* return ok if the key can be found in an old keyfile */ 826 /* return ok if the key can be found in an old keyfile */
806 if (stat(options.system_hostfile2, &st) == 0 || 827 if (stat(options.system_hostfile2, &st) == 0 ||
807 stat(options.user_hostfile2, &st) == 0) { 828 stat(options.user_hostfile2, &st) == 0) {