RSA *private_key;
Key *private; Key *public; int type = dsa_mode ? KEY_DSA : KEY_RSA;
do_change_passphrase(struct passwd *pw){	char *comment;	char *old_passphrase, *passphrase1, *passphrase2;	struct stat st;	RSA *private_key;	if (!have_identity)		ask_filename(pw, "Enter file in which the key is");	if (stat(identity_file, &st) < 0) {		perror(identity_file);		exit(1);	}	public_key = RSA_new();	if (!load_public_key(identity_file, public_key, NULL)) {		printf("%s is not a valid key file.\n", identity_file);		exit(1);	}	/* Clear the public key since we are just about to load the whole file. */	RSA_free(public_key);	/* Try to load the file with empty passphrase. */	private_key = RSA_new();	if (!load_private_key(identity_file, "", private_key, &comment)) {		if (identity_passphrase)			old_passphrase = xstrdup(identity_passphrase);		else			old_passphrase = read_passphrase("Enter old passphrase: ", 1);		if (!load_private_key(identity_file, old_passphrase, private_key, &comment)) {			memset(old_passphrase, 0, strlen(old_passphrase));			xfree(old_passphrase);			printf("Bad passphrase.\n");			exit(1);		}		memset(old_passphrase, 0, strlen(old_passphrase));		xfree(old_passphrase);	}	printf("Key has comment '%s'\n", comment);	/* Ask the new passphrase (twice). */	if (identity_new_passphrase) {		passphrase1 = xstrdup(identity_new_passphrase);		passphrase2 = NULL;	} else {		passphrase1 =			read_passphrase("Enter new passphrase (empty for no passphrase): ", 1);		passphrase2 = read_passphrase("Enter same passphrase again: ", 1);		/* Verify that they are the same. */		if (strcmp(passphrase1, passphrase2) != 0) {			memset(passphrase1, 0, strlen(passphrase1));			memset(passphrase2, 0, strlen(passphrase2));			xfree(passphrase1);			xfree(passphrase2);			printf("Pass phrases do not match.  Try again.\n");			exit(1);		}		/* Destroy the other copy. */		memset(passphrase2, 0, strlen(passphrase2));		xfree(passphrase2);	}	/* Save the file using the new passphrase. */	if (!save_private_key(identity_file, passphrase1, private_key, comment)) {		printf("Saving the key failed: %s: %s.\n",		       identity_file, strerror(errno));		memset(passphrase1, 0, strlen(passphrase1));		xfree(passphrase1);		RSA_free(private_key);		xfree(comment);		exit(1);	}	/* Destroy the passphrase and the copy of the key in memory. */	memset(passphrase1, 0, strlen(passphrase1));	xfree(passphrase1);	RSA_free(private_key);	/* Destroys contents */	xfree(comment);	printf("Your identification has been saved with the new passphrase.\n");	exit(0);}