+void
+do_fingerprint(struct passwd *pw)
+{
+ char *file, *comment;
+ RSA *public_key;
+ struct stat st;
+
+ file = get_filename(pw, "Enter file in which the key is");
+ if (stat(file, &st) < 0)
+ {
+ perror(file);
+ exit(1);
+ }
+ public_key = RSA_new();
+ if (!load_public_key(file, public_key, &comment)) {
+ char *cp, line[1024];
+ BIGNUM *e, *n;
+ int dummy, invalid = 0;
+ FILE *f = fopen(file, "r");
+ n = BN_new();
+ e = BN_new();
+ if (f && fgets(line, sizeof(line), f)) {
+ cp = line;
+ line[strlen(line)-1] = '\0';
+ if (auth_rsa_read_key(&cp, &dummy, e, n)) {
+ public_key->e = e;
+ public_key->n = n;
+ comment = xstrdup(cp ? cp : "no comment");
+ } else {
+ invalid = 1;
+ }
+ } else {
+ invalid = 1;
+ }
+ if (invalid) {
+ printf("%s is not a valid key file.\n", file);
+ BN_free(e);
+ BN_free(n);
+ exit(1);
+ }
+ }
+
+ printf("%d %s %s\n", BN_num_bits(public_key->n),
+ fingerprint(public_key->e, public_key->n),
+ comment);
+ RSA_free(public_key);
+ exit(0);
+}
+
+
+void
+do_change_passphrase(struct passwd *pw)
+{
+ char *file, *comment;
+ char *old_passphrase, *passphrase1, *passphrase2;
+ struct stat st;
+ RSA *private_key;
+
+ file = get_filename(pw, "Enter file in which the key is");