-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing inconsistent crypto consts #190
Fixing inconsistent crypto consts #190
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for this!
@@ -10,13 +10,16 @@ use crate::error::KmipError; | |||
#[cfg(feature = "fips")] | |||
use crate::kmip_bail; | |||
|
|||
/// Minimum random salt size in bytes to use when deriving keys. | |||
const FIPS_MIN_SALT_SIZE: usize = 16; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
size in bytes
and size in bits
are a bit confusing. Does it make sense to uniformize them in the same unity ? Could we adopt a naming variable convention to make it clear that those constants are in bytes or in bits. Also, I see XXX_KLEN
, XXX_HLEN
, XXX_SIZE
, XXX_SIZE_BITS
and XXX_LENGTH
. Should we use a unique suffix to those variables (_SIZE for example?)
4a2b9ca
into
186-accurate-cryptographicusagemask-for-kmip-creation-of-rsa-keys
…189) * feat: dynamic cryptographic usage mask set and check * feat: code enhancement * feat: style + load provider in fips tests * feat: load fips provider on rsa tests * fix: inconsistent crypto consts (#190) * feat: harmonising crypto consts in bits * feat: style + load provider in fips tests * feat: load fips provider on rsa tests * fix: better const naming for passwd derivation
…ic curves and RSA (#187 and #189) * Move crypto subcrate into kmip and dispatch other elements * Remove unused feature curve25519 * Set openssl as wanted feature for kmip deps in pyo3 * Update patched iana-time-zone to a non yanked version * feat: better crypto const organization * feat: better zeroization * feat: finalize zeroization * revert type in kmip operation back to vec<u8> * fix build * revert commit reverting zeroizing + modification attempt at serializer * Temporarily ignore rustsec from pqc-kyber * feat: code enhancement deserialize * feat: dynamic cryptographic algorithm and usage for creation. Tests fail * feat: dynami mask and cryptographic algorithm for ecc key creation * fix: loose comparison * feat: tests + refacto dynamic mask and algo for ecc key creation * fix: fix compile from bad merge * fix lint * feat: distinguish private and public key masks * fix: remove redundant refrence * feat: code enhancement * fix: unused variable in non-fips mode * feat: style + load provider in fips tests * fix: remove P-192 from fips mask construction * feat: accurate CryptographicUsageMask for KMIP creation of RSA keys (#189) * feat: dynamic cryptographic usage mask set and check * feat: code enhancement * feat: style + load provider in fips tests * feat: load fips provider on rsa tests * fix: inconsistent crypto consts (#190) * feat: harmonising crypto consts in bits * feat: style + load provider in fips tests * feat: load fips provider on rsa tests * fix: better const naming for passwd derivation --------- Co-authored-by: ThibsG <thibsg@pm.me>
Declared crypto consts were describing sizes in both bits and bytes resulting in inconsistent comparisons and harder to read code.