switched fopen for why2_fopen in crypto

whoopsie
This commit is contained in:
Václav Šmejkal 2024-04-13 13:09:54 +02:00
parent 60b437d4e8
commit 5bd948c8a0
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -127,8 +127,8 @@ void why2_chat_init_keys(void)
printf("Saving keys...\n"); printf("Saving keys...\n");
//WRITE THE KEYS INTO KEY-FILES //WRITE THE KEYS INTO KEY-FILES
public = fopen(public_path, "w+"); public = why2_fopen(public_path, "w+");
private = fopen(private_path, "w+"); private = why2_fopen(private_path, "w+");
mpz_out_str(public, WHY2_CHAT_KEY_BASE, n); mpz_out_str(public, WHY2_CHAT_KEY_BASE, n);
mpz_out_str(private, WHY2_CHAT_KEY_BASE, d); mpz_out_str(private, WHY2_CHAT_KEY_BASE, d);
@ -138,8 +138,8 @@ void why2_chat_init_keys(void)
} else } else
{ {
//OPEN FILES //OPEN FILES
public = fopen(public_path, "r"); public = why2_fopen(public_path, "r");
private = fopen(private_path, "r"); private = why2_fopen(private_path, "r");
//READ THE KEYS //READ THE KEYS
read_file(public, &rsa_modulus); read_file(public, &rsa_modulus);
@ -150,8 +150,8 @@ void why2_chat_init_keys(void)
why2_deallocate(path); why2_deallocate(path);
why2_deallocate(public_path); why2_deallocate(public_path);
why2_deallocate(private_path); why2_deallocate(private_path);
fclose(public); why2_deallocate(public);
fclose(private); why2_deallocate(private);
} }
void why2_chat_deallocate_keys(void) void why2_chat_deallocate_keys(void)