diff --git a/src/device.c b/src/device.c index b8910db..7735966 100644 --- a/src/device.c +++ b/src/device.c @@ -73,7 +73,7 @@ int pusb_device_check(t_pusb_options *opts) if (opts->one_time_pad) { log_info("Performing one time pad verification...\n"); - retval = pusb_otp_check(opts, ctx); + retval = pusb_pad_check(opts, ctx); } else { diff --git a/src/otp.c b/src/otp.c index c494c84..2d06ce4 100644 --- a/src/otp.c +++ b/src/otp.c @@ -28,7 +28,7 @@ #include "volume.h" #include "otp.h" -static FILE *pusb_otp_open_device(t_pusb_options *opts, +static FILE *pusb_pad_open_device(t_pusb_options *opts, LibHalVolume *volume, const char *mode) { FILE *f; @@ -59,7 +59,7 @@ static FILE *pusb_otp_open_device(t_pusb_options *opts, return (f); } -static FILE *pusb_otp_open_system(t_pusb_options *opts, const char *mode) +static FILE *pusb_pad_open_system(t_pusb_options *opts, const char *mode) { FILE *f; char *path; @@ -85,7 +85,7 @@ static FILE *pusb_otp_open_system(t_pusb_options *opts, const char *mode) return (f); } -static void pusb_otp_update(t_pusb_options *opts, +static void pusb_pad_update(t_pusb_options *opts, LibHalVolume *volume) { FILE *f_device = NULL; @@ -93,12 +93,12 @@ static void pusb_otp_update(t_pusb_options *opts, int magic[1024]; int i; - if (!(f_device = pusb_otp_open_device(opts, volume, "w+"))) + if (!(f_device = pusb_pad_open_device(opts, volume, "w+"))) { log_error("Unable to update pads.\n"); return ; } - if (!(f_system = pusb_otp_open_system(opts, "w+"))) + if (!(f_system = pusb_pad_open_system(opts, "w+"))) { log_error("Unable to update pads.\n"); fclose(f_device); @@ -119,7 +119,7 @@ static void pusb_otp_update(t_pusb_options *opts, log_debug("One time pads updated.\n"); } -static int pusb_otp_compare(t_pusb_options *opts, LibHalVolume *volume) +static int pusb_pad_compare(t_pusb_options *opts, LibHalVolume *volume) { FILE *f_device = NULL; FILE *f_system = NULL; @@ -127,9 +127,9 @@ static int pusb_otp_compare(t_pusb_options *opts, LibHalVolume *volume) int magic_system[1024]; int retval; - if (!(f_system = pusb_otp_open_system(opts, "r"))) + if (!(f_system = pusb_pad_open_system(opts, "r"))) return (1); - if (!(f_device = pusb_otp_open_device(opts, volume, "r"))) + if (!(f_device = pusb_pad_open_device(opts, volume, "r"))) { fclose(f_system); return (0); @@ -146,7 +146,7 @@ static int pusb_otp_compare(t_pusb_options *opts, LibHalVolume *volume) return (retval == 0); } -int pusb_otp_check(t_pusb_options *opts, LibHalContext *ctx) +int pusb_pad_check(t_pusb_options *opts, LibHalContext *ctx) { LibHalVolume *volume = NULL; int retval; @@ -154,11 +154,11 @@ int pusb_otp_check(t_pusb_options *opts, LibHalContext *ctx) volume = pusb_volume_get(opts, ctx); if (!volume) return (0); - retval = pusb_otp_compare(opts, volume); + retval = pusb_pad_compare(opts, volume); if (retval) { log_info("Verification match, updating one time pads...\n"); - pusb_otp_update(opts, volume); + pusb_pad_update(opts, volume); } else log_error("Pad checking failed !\n"); diff --git a/src/otp.h b/src/otp.h index 91e40e2..d105249 100644 --- a/src/otp.h +++ b/src/otp.h @@ -18,6 +18,6 @@ #ifndef PUSB_OTP_H_ # define PUSB_OTP_H_ -int pusb_otp_check(t_pusb_options *opts, LibHalContext *ctx); +int pusb_pad_check(t_pusb_options *opts, LibHalContext *ctx); #endif /* !PUSB_OTP_H_ */