From 3488933d1d0b765429093decba9f2b6ead8ff94b Mon Sep 17 00:00:00 2001 From: gbucchino Date: Wed, 18 Feb 2026 16:05:24 +0100 Subject: [PATCH] remove unused variable --- audit/fips.c | 18 +++++++++--------- audit/fips.h | 10 +++++----- certificate.c | 2 +- cryptodit | Bin 41672 -> 41672 bytes 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/audit/fips.c b/audit/fips.c index f56438e..db0816b 100644 --- a/audit/fips.c +++ b/audit/fips.c @@ -12,28 +12,28 @@ static int DEBUG = 0; -int fips(const char *pkey, struct audit_fips *st_audit_fips, struct keyinfo *st_keyinfo, const int type, const int is_pubkey, const int to_stdout){ +int fips(const char *pkey, struct audit_fips *st_audit_fips, struct keyinfo *st_keyinfo, const int type, const int is_pubkey){ int res; if(type == TYPE_RSA){ /* If it's a pub key, we are going to analyse it */ if (is_pubkey == 1) - res = fips_pubkey_rsa(st_audit_fips, st_keyinfo, pkey, to_stdout); + res = fips_pubkey_rsa(st_audit_fips, st_keyinfo, pkey); else - res = fips_privkey_rsa(st_audit_fips, st_keyinfo, pkey, to_stdout); + res = fips_privkey_rsa(st_audit_fips, st_keyinfo, pkey); } else if (type == TYPE_X509){ if (openssl_version() == 1) - res = fips_x509_v1(st_audit_fips, st_keyinfo, pkey, to_stdout); + res = fips_x509_v1(st_audit_fips, st_keyinfo, pkey); else - res = fips_x509_v3(st_audit_fips, st_keyinfo, pkey, to_stdout); + res = fips_x509_v3(st_audit_fips, st_keyinfo, pkey); } return res; } /* * This function load public RSA key and make an audit on it */ -static int fips_pubkey_rsa(struct audit_fips *st_audit_fips, struct keyinfo *st_keyinfo, const char *pkey, const int to_stdout) { +static int fips_pubkey_rsa(struct audit_fips *st_audit_fips, struct keyinfo *st_keyinfo, const char *pkey) { struct rsa *rsa; size_t keysize; int res; @@ -62,7 +62,7 @@ static int fips_pubkey_rsa(struct audit_fips *st_audit_fips, struct keyinfo *st_ /* * This function audit RSA private key */ -static int fips_privkey_rsa(struct audit_fips *st_audit_fips, struct keyinfo *st_keyinfo, const char *pkey, const int to_stdout) { +static int fips_privkey_rsa(struct audit_fips *st_audit_fips, struct keyinfo *st_keyinfo, const char *pkey) { int res; struct rsa *rsa = NULL; @@ -342,7 +342,7 @@ static int check_exponent(const BIGNUM *e, char *buf, unsigned long *exponent){ /* * This function load X509 certificate for OpenSSL v1 */ -static int fips_x509_v1(struct audit_fips *st_audit_fips, struct keyinfo *st_keyinfo, const char *pkey, const int to_stdout){ +static int fips_x509_v1(struct audit_fips *st_audit_fips, struct keyinfo *st_keyinfo, const char *pkey){ struct rsa *rsa = (struct rsa*)malloc(sizeof(struct rsa*)); if (rsa == NULL){ @@ -389,7 +389,7 @@ static int fips_x509_v1(struct audit_fips *st_audit_fips, struct keyinfo *st_key /* * This function load X509 certificate for OpenSSL v3 */ -static int fips_x509_v3(struct audit_fips *st_audit_fips, struct keyinfo *st_keyinfo, const char *pkey, const int to_stdout){ +static int fips_x509_v3(struct audit_fips *st_audit_fips, struct keyinfo *st_keyinfo, const char *pkey){ struct rsa *rsa = (struct rsa*)malloc(sizeof(struct rsa*)); if (rsa == NULL){ diff --git a/audit/fips.h b/audit/fips.h index d5764a1..a8679ef 100644 --- a/audit/fips.h +++ b/audit/fips.h @@ -40,10 +40,10 @@ struct keyinfo{ int algo; }; -int fips(const char *, struct audit_fips *, struct keyinfo *, const int, const int, const int); +int fips(const char *, struct audit_fips *, struct keyinfo *, const int, const int); /* RSA */ -static int fips_pubkey_rsa(struct audit_fips *, struct keyinfo *, const char *, const int); -static int fips_privkey_rsa(struct audit_fips *, struct keyinfo *, const char *, const int); +static int fips_pubkey_rsa(struct audit_fips *, struct keyinfo *, const char *); +static int fips_privkey_rsa(struct audit_fips *, struct keyinfo *, const char *); static int loadkeys_rsa_v1(struct rsa **, const char *, int *format); static int loadkeys_rsa_v3(struct rsa **, const char *, int *format); static int load_priv_rsa_keys_v1(struct rsa **, const char *); @@ -51,8 +51,8 @@ static int load_priv_rsa_keys_v3(struct rsa **, const char *); static void audit_rsa_keys(struct rsa *, struct audit_fips *, struct keyinfo *, const char *); /* X509 */ -static int fips_x509_v1(struct audit_fips *, struct keyinfo *, const char *, const int); -static int fips_x509_v3(struct audit_fips *, struct keyinfo *, const char *, const int); +static int fips_x509_v1(struct audit_fips *, struct keyinfo *, const char *); +static int fips_x509_v3(struct audit_fips *, struct keyinfo *, const char *); static int check_exponent(const BIGNUM *, char *, unsigned long *); static void clean_rsa_st(struct rsa *); diff --git a/certificate.c b/certificate.c index 78f71a9..bc50025 100644 --- a/certificate.c +++ b/certificate.c @@ -94,7 +94,7 @@ int certificate(char **argv, const int argc){ printf("Cannot decrypt x509 certifcate, it is not implemented yet\n"); return 0; }*/ - res = fips(buf_pkey, &st_audit_fips, &st_keyinfo, type, is_pubkey, to_stdout); + res = fips(buf_pkey, &st_audit_fips, &st_keyinfo, type, is_pubkey); if (res < 0){ printf("Error during check FIPS compliance\n"); return -1; diff --git a/cryptodit b/cryptodit index ea28b1eb53f3358d14810fc4364b0ee0ed124f0b..f1f698583f2ec192481ca89678dd5840fcad445b 100755 GIT binary patch delta 5866 zcmZ`-3v^6p9=~^zA&Eq!CXt7{5h0p~ctl7da+8Ty5YaB}DTlMFwB)R5wUwrA45njL z_fJdLdbGMrcWIcj8XA=rO+pc+grY%km9(K$s@mD#_sAry%{lIO|L@=b_r30@Ibf(c zU?}%ey=w<5{IAv-pw2Xy%DWl}cS6bY_RO`45-NY^&Dark9cux^#L_ zSxC;L1of!1A<3cA{FG=~of2L;JPCn_sJ-KIiS##BmdZFv8p>g?TQ{JZ!*qZ(AOzc2 z@W~QB6-=$)y@}d(>t=YGxpioJ>uFf+)+!jwT2zZag8MP^Y?LnG6@XYek>Ljn}EXt;}(1igJ zzMCFrh>x)FY$_TM?`z?TlT5Ld-WrhXJG4zPkE#a@_Wiw|J7gIx9GIfcqKttlzSO1; zW`^u;0W~}lsxEnwS^J~&z`!lZ)+++*;6+F&9SPPHRRw-nQa_OAq>Lh zbO#nx)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