130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
*/
ret = verify_host_key(host, port, keytype, keystr);
if (ret == 0) /* success - key matched OK */
return;
if (ret == 2) { /* key was different */
fprintf(stderr, wrongmsg, fingerprint);
if (fgets(line, sizeof(line), stdin) &&
line[0] != '\0' && line[0] != '\n') {
if (line[0] == 'y' || line[0] == 'Y')
store_host_key(host, port, keytype, keystr);
} else {
fprintf(stderr, abandoned);
exit(0);
}
}
if (ret == 1) { /* key was absent */
fprintf(stderr, absentmsg, fingerprint);
if (fgets(line, sizeof(line), stdin) &&
(line[0] == 'y' || line[0] == 'Y'))
|
>
>
|
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
*/
ret = verify_host_key(host, port, keytype, keystr);
if (ret == 0) /* success - key matched OK */
return;
if (ret == 2) { /* key was different */
fprintf(stderr, wrongmsg, fingerprint);
fflush(stderr);
if (fgets(line, sizeof(line), stdin) &&
line[0] != '\0' && line[0] != '\n') {
if (line[0] == 'y' || line[0] == 'Y')
store_host_key(host, port, keytype, keystr);
} else {
fprintf(stderr, abandoned);
fflush(stderr);
exit(0);
}
}
if (ret == 1) { /* key was absent */
fprintf(stderr, absentmsg, fingerprint);
if (fgets(line, sizeof(line), stdin) &&
(line[0] == 'y' || line[0] == 'Y'))
|