Skip to content

Commit ea0d5f7

Browse files
authored
pkcs12: add KDF security warning (#1319)
Quotes RFC 7292 Appendix B on why the PKCS#12 KDF is a poor choice which is deprecated for new usage
1 parent 3549a2c commit ea0d5f7

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

pkcs12/src/kdf.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1-
//! Implementation of the key derivation function
2-
//! [RFC 7292 Appendix B](https://datatracker.ietf.org/doc/html/rfc7292#appendix-B)
1+
//! Implementation of the PKCS#12 key derivation function as described in
2+
//! [RFC 7292 Appendix B](https://datatracker.ietf.org/doc/html/rfc7292#appendix-B).
3+
//!
4+
//! ## ⚠️ Security Warning
5+
//!
6+
//! This KDF is considered poor quality by today's standards as noted in the aforementioned RFC:
7+
//!
8+
//! > Note that this method for password privacy mode is not recommended
9+
//! > and is deprecated for new usage. The procedures and algorithms
10+
//! > defined in PKCS #5 v2.1 should be used instead.
11+
//! > Specifically, PBES2 should be used as encryption scheme, with PBKDF2
12+
//! > as the key derivation function.
13+
//!
14+
//! See the [`pkcs5`](https://docs.rs/pkcs5) crate for an implementation of PKCS #5, or the
15+
//! [`argon2`](https://docs.rs/argon2) crate for a state-of-the-art password-based KDF.
316
417
use alloc::{vec, vec::Vec};
518
use der::asn1::BmpString;

0 commit comments

Comments
 (0)