Skip to content
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

Pull Request for the wrapper class of Team TechShield (USB-Dongles) #8

Merged
merged 93 commits into from
Jun 20, 2024

Conversation

yenkkes
Copy link
Contributor

@yenkkes yenkkes commented Jun 3, 2024

All functions should work in this branch, the code is ready to be pentested.

std = []
tpm = []
win = ["tpm", "windows"]
yubi = ["hsm", "yubikey"]

[dependencies]
yubikey = { version = "0.8.0", optional = true, features = ["untested"] }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please be aware that yubikey 0.8.0 depends ons rsa 0.9.6:

Crate: rsa
Version: 0.9.6
Title: Marvin Attack: potential key recovery through timing sidechannels
Date: 2023-11-22
ID: RUSTSEC-2023-0071
URL: https://rustsec.org/advisories/RUSTSEC-2023-0071
Severity: 5.9 (medium)
Solution: No fixed upgrade is available!

I don't see any update available for RSA to address this yet. In security, when you cannot update a vulnerability, then you need to perform a risk assessment, and propose mitigations, where possible. See RustCrypto/RSA#19 (comment). Are there any steps users can take to protect themselves against this? If so, please document your recommendations - perhaps in your readme.

match key_algo {
AsymmetricEncryption::Rsa(KeyBits::Bits1024) => {
algorithm_id = AlgorithmId::Rsa1024;
vec_data = apply_pkcs1v15_padding(&vec_data, 128);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace magic values with constants.

}
AsymmetricEncryption::Rsa(KeyBits::Bits2048) => {
algorithm_id = AlgorithmId::Rsa2048;
vec_data = apply_pkcs1v15_padding(&vec_data, 256);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace magic values with constants.

}
}
// Hier muesste die Pin Eingabe und die Managementkey Eingabe implementiert werden. Ist aktuell hardcoded.
self.pin = "123456".to_string();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded pins should be avoided. Please see if you can find a more elegant way to manage the pin.

@ngussek ngussek merged commit 505824f into nmshd:main Jun 20, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants