Lines Matching refs:identity_file
109 char identity_file[1024]; variable
265 snprintf(identity_file, sizeof(identity_file), in ask_filename()
267 printf("%s (%s): ", prompt, identity_file); in ask_filename()
273 strlcpy(identity_file, buf, sizeof(identity_file)); in ask_filename()
389 if (stat(identity_file, &st) < 0) in do_convert_to()
390 fatal("%s: %s: %s", __progname, identity_file, strerror(errno)); in do_convert_to()
391 if ((r = sshkey_load_public(identity_file, &k, NULL)) != 0) in do_convert_to()
392 k = load_identity(identity_file); in do_convert_to()
574 if ((fp = fopen(identity_file, "r")) == NULL) in do_convert_from_ssh2()
575 fatal("%s: %s: %s", __progname, identity_file, strerror(errno)); in do_convert_from_ssh2()
619 if ((fp = fopen(identity_file, "r")) == NULL) in do_convert_from_pkcs8()
620 fatal("%s: %s: %s", __progname, identity_file, strerror(errno)); in do_convert_from_pkcs8()
623 identity_file); in do_convert_from_pkcs8()
665 if ((fp = fopen(identity_file, "r")) == NULL) in do_convert_from_pem()
666 fatal("%s: %s: %s", __progname, identity_file, strerror(errno)); in do_convert_from_pem()
699 if (stat(identity_file, &st) < 0) in do_convert_from()
700 fatal("%s: %s: %s", __progname, identity_file, strerror(errno)); in do_convert_from()
759 if (stat(identity_file, &st) < 0) in do_print_public()
760 fatal("%s: %s", identity_file, strerror(errno)); in do_print_public()
761 prv = load_identity(identity_file); in do_print_public()
864 if (stat(identity_file, &st) < 0) in fingerprint_private()
892 path = identity_file; in do_fingerprint()
894 if (strcmp(identity_file, "-") == 0) { in do_fingerprint()
918 if (lnum == 1 && strcmp(identity_file, "-") != 0 && in do_fingerprint()
1018 strlcpy(identity_file, key_types[i].path, sizeof(identity_file)); in do_gen_all_hostkeys()
1030 if ((r = sshkey_save_private(private, identity_file, "", in do_gen_all_hostkeys()
1033 identity_file, ssh_err(r)); in do_gen_all_hostkeys()
1040 strlcat(identity_file, ".pub", sizeof(identity_file)); in do_gen_all_hostkeys()
1041 fd = open(identity_file, O_WRONLY | O_CREAT | O_TRUNC, 0644); in do_gen_all_hostkeys()
1044 identity_file); in do_gen_all_hostkeys()
1051 error("fdopen %s failed", identity_file); in do_gen_all_hostkeys()
1200 if (strlcpy(identity_file, cp, sizeof(identity_file)) >= in do_known_hosts()
1201 sizeof(identity_file)) in do_known_hosts()
1216 if (strlcpy(tmp, identity_file, sizeof(tmp)) >= sizeof(tmp) || in do_known_hosts()
1218 strlcpy(old, identity_file, sizeof(old)) >= sizeof(old) || in do_known_hosts()
1235 if ((r = hostkeys_foreach(identity_file, in do_known_hosts()
1247 error("%s is not a valid known_hosts file.", identity_file); in do_known_hosts()
1255 logit("Host %s not found in %s", name, identity_file); in do_known_hosts()
1262 if (link(identity_file, old) == -1) in do_known_hosts()
1263 fatal("link %.100s to %.100s: %s", identity_file, old, in do_known_hosts()
1266 if (rename(tmp, identity_file) == -1) { in do_known_hosts()
1267 error("rename\"%s\" to \"%s\": %s", tmp, identity_file, in do_known_hosts()
1274 printf("%s updated.\n", identity_file); in do_known_hosts()
1301 if (stat(identity_file, &st) < 0) in do_change_passphrase()
1302 fatal("%s: %s", identity_file, strerror(errno)); in do_change_passphrase()
1304 r = sshkey_load_private(identity_file, "", &private, &comment); in do_change_passphrase()
1312 r = sshkey_load_private(identity_file, old_passphrase, in do_change_passphrase()
1320 fatal("Failed to load key %s: %s", identity_file, ssh_err(r)); in do_change_passphrase()
1351 if ((r = sshkey_save_private(private, identity_file, passphrase1, in do_change_passphrase()
1354 identity_file, ssh_err(r)); in do_change_passphrase()
1413 if (stat(identity_file, &st) < 0) in do_change_comment()
1414 fatal("%s: %s", identity_file, strerror(errno)); in do_change_comment()
1415 if ((r = sshkey_load_private(identity_file, "", in do_change_comment()
1420 identity_file, ssh_err(r)); in do_change_comment()
1430 if ((r = sshkey_load_private(identity_file, passphrase, in do_change_comment()
1435 identity_file, ssh_err(r)); in do_change_comment()
1466 if ((r = sshkey_save_private(private, identity_file, passphrase, in do_change_comment()
1469 identity_file, ssh_err(r)); in do_change_comment()
1482 strlcat(identity_file, ".pub", sizeof(identity_file)); in do_change_comment()
1483 fd = open(identity_file, O_WRONLY | O_CREAT | O_TRUNC, 0644); in do_change_comment()
1485 fatal("Could not save your public key in %s", identity_file); in do_change_comment()
1488 fatal("fdopen %s failed: %s", identity_file, strerror(errno)); in do_change_comment()
1939 if (strcmp(identity_file, "-") != 0 && stat(identity_file, &st) < 0) in do_show_cert()
1940 fatal("%s: %s: %s", __progname, identity_file, strerror(errno)); in do_show_cert()
1942 path = identity_file; in do_show_cert()
1947 } else if ((f = fopen(identity_file, "r")) == NULL) in do_show_cert()
1948 fatal("fopen %s: %s", identity_file, strerror(errno)); in do_show_cert()
2135 if (*identity_file == '\0') in do_gen_krl()
2137 if (stat(identity_file, &sb) == -1) { in do_gen_krl()
2140 identity_file, strerror(errno)); in do_gen_krl()
2142 fatal("KRL \"%s\" does not exist", identity_file); in do_gen_krl()
2157 load_krl(identity_file, &krl); in do_gen_krl()
2173 if ((fd = open(identity_file, O_WRONLY|O_CREAT|O_TRUNC, 0644)) == -1) in do_gen_krl()
2174 fatal("open %s: %s", identity_file, strerror(errno)); in do_gen_krl()
2177 fatal("write %s: %s", identity_file, strerror(errno)); in do_gen_krl()
2192 if (*identity_file == '\0') in do_check_krl()
2194 load_krl(identity_file, &krl); in do_check_krl()
2374 if (strlcpy(identity_file, optarg, in main()
2375 sizeof(identity_file)) >= sizeof(identity_file)) in main()
2574 identity_file, rr_hostname); in main()
2576 fatal("%s: %s", identity_file, strerror(errno)); in main()
2615 if (have_identity && strcmp(identity_file, "-") != 0) { in main()
2616 if ((in = fopen(identity_file, "r")) == NULL) { in main()
2618 "file \"%s\": %s", identity_file, in main()
2661 if (strstr(identity_file, dotsshdir) != NULL) { in main()
2674 if (stat(identity_file, &st) >= 0) { in main()
2676 printf("%s already exists.\n", identity_file); in main()
2721 if ((r = sshkey_save_private(private, identity_file, passphrase1, in main()
2724 identity_file, ssh_err(r)); in main()
2737 printf("Your identification has been saved in %s.\n", identity_file); in main()
2739 strlcat(identity_file, ".pub", sizeof(identity_file)); in main()
2740 if ((fd = open(identity_file, O_WRONLY|O_CREAT|O_TRUNC, 0644)) == -1) in main()
2742 identity_file, strerror(errno)); in main()
2744 fatal("fdopen %s failed: %s", identity_file, strerror(errno)); in main()
2758 identity_file); in main()