diff options
author | Dmitry Belyavskiy <beldmit@gmail.com> | 2024-06-07 14:38:40 +0200 |
---|---|---|
committer | Dmitry Belyavskiy <beldmit@gmail.com> | 2024-08-07 10:00:16 +0200 |
commit | 38aa61e5a7f923d93f5c7a48c71d57938a929289 (patch) | |
tree | 755cad69ee4a1e9854e10aa68a433650c47fd190 /doc/man3 | |
parent | Implementation of the RFC 9579, PBMAC1 in PKCS#12 (diff) | |
download | openssl-38aa61e5a7f923d93f5c7a48c71d57938a929289.tar.xz openssl-38aa61e5a7f923d93f5c7a48c71d57938a929289.zip |
Implementation of the RFC 9579, PBMAC1 in PKCS#12 - documentation
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24577)
Diffstat (limited to 'doc/man3')
-rw-r--r-- | doc/man3/PBMAC1_get1_pbkdf2_param.pod | 46 | ||||
-rw-r--r-- | doc/man3/PKCS12_gen_mac.pod | 37 | ||||
-rw-r--r-- | doc/man3/X509_dup.pod | 3 | ||||
-rw-r--r-- | doc/man3/d2i_X509.pod | 2 |
4 files changed, 80 insertions, 8 deletions
diff --git a/doc/man3/PBMAC1_get1_pbkdf2_param.pod b/doc/man3/PBMAC1_get1_pbkdf2_param.pod new file mode 100644 index 0000000000..415c3cd214 --- /dev/null +++ b/doc/man3/PBMAC1_get1_pbkdf2_param.pod @@ -0,0 +1,46 @@ +=pod + +=head1 NAME + +PBMAC1_get1_pbkdf2_param - Function to manipulate a PBMAC1 +MAC structure + +=head1 SYNOPSIS + + #include <openssl/x509.h> + + PBKDF2PARAM *PBMAC1_get1_pbkdf2_param(const X509_ALGOR *macalg); + +=head1 DESCRIPTION + +PBMAC1_get1_pbkdf2_param() retrieves a B<PBKDF2PARAM> structure from an +I<X509_ALGOR> structure. + +=head1 RETURN VALUES + +PBMAC1_get1_pbkdf2_param() returns NULL in case when PBMAC1 uses an algorithm +apart from B<PBKDF2> or when passed incorrect parameters and a pointer to +B<PBKDF2PARAM> structure otherwise. + +=head1 CONFORMING TO + +IETF RFC 9579 (L<https://tools.ietf.org/html/rfc9579>) + +=head1 SEE ALSO + +L<openssl-pkcs12(1)> + +=head1 HISTORY + +The I<PBMAC1_get1_pbkdf2_param> function was added in OpenSSL 3.4. + +=head1 COPYRIGHT + +Copyright 2021-2024 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L<https://www.openssl.org/source/license.html>. + +=cut diff --git a/doc/man3/PKCS12_gen_mac.pod b/doc/man3/PKCS12_gen_mac.pod index a72df145fe..ebeee98f04 100644 --- a/doc/man3/PKCS12_gen_mac.pod +++ b/doc/man3/PKCS12_gen_mac.pod @@ -3,7 +3,8 @@ =head1 NAME PKCS12_gen_mac, PKCS12_setup_mac, PKCS12_set_mac, -PKCS12_verify_mac - Functions to create and manipulate a PKCS#12 structure +PKCS12_set_pbmac1_pbkdf2, PKCS12_verify_mac, PKCS12_get0_mac - +Functions to create and manipulate a PKCS#12 MAC structure =head1 SYNOPSIS @@ -15,9 +16,19 @@ PKCS12_verify_mac - Functions to create and manipulate a PKCS#12 structure int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen, unsigned char *salt, int saltlen, int iter, const EVP_MD *md_type); + int PKCS12_set_pbmac1_pbkdf2(PKCS12 *p12, const char *pass, int passlen, + unsigned char *salt, int saltlen, int iter, + const EVP_MD *md_type, + const char *prf_md_name); int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, int saltlen, const EVP_MD *md_type); + void PKCS12_get0_mac(const ASN1_OCTET_STRING **pmac, + const X509_ALGOR **pmacalg, + const ASN1_OCTET_STRING **psalt, + const ASN1_INTEGER **piter, + const PKCS12 *p12); + =head1 DESCRIPTION PKCS12_gen_mac() generates an HMAC over the entire PKCS#12 object using the @@ -31,10 +42,15 @@ PKCS12_setup_mac() sets the MAC part of the PKCS#12 structure with the supplied parameters. PKCS12_set_mac() sets the MAC and MAC parameters into the PKCS#12 object. +PKCS12_set_pbmac1_pbkdf2() sets the MAC and MAC parameters into the PKCS#12 +object when B<PBMAC1> with PBKDF2 is used for protection of the PKCS#12 object. I<pass> is the passphrase to use in the HMAC. I<salt> is the salt value to use, -I<iter> is the iteration count and I<md_type> is the message digest -function to use. +I<iter> is the iteration count and I<md_type> is the message digest function to +use. I<prf_md_name> specifies the digest used for the PBKDF2 in PBMAC1 KDF. + +PKCS12_get0_mac() retrieves any included MAC value, B<X509_ALGOR> object, +I<salt>, and I<iter> count from the PKCS12 object. =head1 NOTES @@ -43,17 +59,18 @@ If I<salt> is NULL then a suitable salt will be generated and used. If I<iter> is 1 then an iteration count will be omitted from the PKCS#12 structure. -PKCS12_gen_mac(), PKCS12_verify_mac() and PKCS12_set_mac() make assumptions -regarding the encoding of the given passphrase. See L<passphrase-encoding(7)> -for more information. +PKCS12_gen_mac(), PKCS12_verify_mac(), PKCS12_set_mac() and +PKCS12_set_pbmac1_pbkdf2() make assumptions regarding the encoding of the +given passphrase. See L<passphrase-encoding(7)> for more information. =head1 RETURN VALUES -All functions return 1 on success and 0 if an error occurred. +All functions returning an integer return 1 on success and 0 if an error occurred. =head1 CONFORMING TO IETF RFC 7292 (L<https://tools.ietf.org/html/rfc7292>) +IETF RFC 9579 (L<https://tools.ietf.org/html/rfc9579>) =head1 SEE ALSO @@ -62,9 +79,13 @@ L<EVP_KDF-PKCS12KDF(7)>, L<PKCS12_create(3)>, L<passphrase-encoding(7)> +=head1 HISTORY + +The I<PKCS12_set_pbmac1_pbkdf2> function was added in OpenSSL 3.4. + =head1 COPYRIGHT -Copyright 2021-2023 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2021-2024 The OpenSSL Project Authors. All Rights Reserved. Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/doc/man3/X509_dup.pod b/doc/man3/X509_dup.pod index fc93494a76..81ea2275d7 100644 --- a/doc/man3/X509_dup.pod +++ b/doc/man3/X509_dup.pod @@ -218,6 +218,9 @@ PBEPARAM_free, PBEPARAM_new, PBKDF2PARAM_free, PBKDF2PARAM_new, +PBMAC1PARAM_free, +PBMAC1PARAM_it, +PBMAC1PARAM_new, PKCS12_BAGS_free, PKCS12_BAGS_new, PKCS12_MAC_DATA_free, diff --git a/doc/man3/d2i_X509.pod b/doc/man3/d2i_X509.pod index 75b37e5544..3615bcaafe 100644 --- a/doc/man3/d2i_X509.pod +++ b/doc/man3/d2i_X509.pod @@ -115,6 +115,7 @@ d2i_OTHERNAME, d2i_PBE2PARAM, d2i_PBEPARAM, d2i_PBKDF2PARAM, +d2i_PBMAC1PARAM, d2i_PKCS12, d2i_PKCS12_BAGS, d2i_PKCS12_MAC_DATA, @@ -300,6 +301,7 @@ i2d_OTHERNAME, i2d_PBE2PARAM, i2d_PBEPARAM, i2d_PBKDF2PARAM, +i2d_PBMAC1PARAM, i2d_PKCS12, i2d_PKCS12_BAGS, i2d_PKCS12_MAC_DATA, |