summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2024-03-02 10:17:37 +0000
committertb <>2024-03-02 10:17:37 +0000
commitfdfad9e1701882b4e72b41155a9c8e4ef338ddbf (patch)
tree4111116bc9b99272485abcc1794b98f58991ba5f
parentb88286b09abf67a2644f5e950fb27492f55b3b3e (diff)
downloadopenbsd-fdfad9e1701882b4e72b41155a9c8e4ef338ddbf.tar.gz
openbsd-fdfad9e1701882b4e72b41155a9c8e4ef338ddbf.tar.bz2
openbsd-fdfad9e1701882b4e72b41155a9c8e4ef338ddbf.zip
Remove most PBEPARAM stuff from public visibility
The struct itself needs to remain public, unfortunately. ok jsing
-rw-r--r--src/lib/libcrypto/Symbols.list14
-rw-r--r--src/lib/libcrypto/asn1/p5_pbe.c4
-rw-r--r--src/lib/libcrypto/asn1/p5_pbev2.c3
-rw-r--r--src/lib/libcrypto/evp/evp_pbe.c3
-rw-r--r--src/lib/libcrypto/x509/x509.h33
-rw-r--r--src/lib/libcrypto/x509/x509_local.h33
6 files changed, 40 insertions, 50 deletions
diff --git a/src/lib/libcrypto/Symbols.list b/src/lib/libcrypto/Symbols.list
index 88c618de26..7a27d6d1a3 100644
--- a/src/lib/libcrypto/Symbols.list
+++ b/src/lib/libcrypto/Symbols.list
@@ -1810,15 +1810,7 @@ OpenSSL_add_all_ciphers
1810OpenSSL_add_all_digests 1810OpenSSL_add_all_digests
1811OpenSSL_version 1811OpenSSL_version
1812OpenSSL_version_num 1812OpenSSL_version_num
1813PBE2PARAM_free
1814PBE2PARAM_it
1815PBE2PARAM_new
1816PBEPARAM_free
1817PBEPARAM_it 1813PBEPARAM_it
1818PBEPARAM_new
1819PBKDF2PARAM_free
1820PBKDF2PARAM_it
1821PBKDF2PARAM_new
1822PEM_ASN1_read 1814PEM_ASN1_read
1823PEM_ASN1_read_bio 1815PEM_ASN1_read_bio
1824PEM_ASN1_write 1816PEM_ASN1_write
@@ -3182,9 +3174,6 @@ d2i_OCSP_SERVICELOC
3182d2i_OCSP_SIGNATURE 3174d2i_OCSP_SIGNATURE
3183d2i_OCSP_SINGLERESP 3175d2i_OCSP_SINGLERESP
3184d2i_OTHERNAME 3176d2i_OTHERNAME
3185d2i_PBE2PARAM
3186d2i_PBEPARAM
3187d2i_PBKDF2PARAM
3188d2i_PKCS12 3177d2i_PKCS12
3189d2i_PKCS12_SAFEBAG 3178d2i_PKCS12_SAFEBAG
3190d2i_PKCS12_bio 3179d2i_PKCS12_bio
@@ -3377,9 +3366,6 @@ i2d_OCSP_SERVICELOC
3377i2d_OCSP_SIGNATURE 3366i2d_OCSP_SIGNATURE
3378i2d_OCSP_SINGLERESP 3367i2d_OCSP_SINGLERESP
3379i2d_OTHERNAME 3368i2d_OTHERNAME
3380i2d_PBE2PARAM
3381i2d_PBEPARAM
3382i2d_PBKDF2PARAM
3383i2d_PKCS12 3369i2d_PKCS12
3384i2d_PKCS12_SAFEBAG 3370i2d_PKCS12_SAFEBAG
3385i2d_PKCS12_bio 3371i2d_PKCS12_bio
diff --git a/src/lib/libcrypto/asn1/p5_pbe.c b/src/lib/libcrypto/asn1/p5_pbe.c
index 204e818286..0b628b36d9 100644
--- a/src/lib/libcrypto/asn1/p5_pbe.c
+++ b/src/lib/libcrypto/asn1/p5_pbe.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p5_pbe.c,v 1.25 2023/07/07 19:37:52 beck Exp $ */ 1/* $OpenBSD: p5_pbe.c,v 1.26 2024/03/02 10:17:37 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -64,6 +64,8 @@
64#include <openssl/err.h> 64#include <openssl/err.h>
65#include <openssl/x509.h> 65#include <openssl/x509.h>
66 66
67#include "x509_local.h"
68
67/* PKCS#5 password based encryption structure */ 69/* PKCS#5 password based encryption structure */
68 70
69static const ASN1_TEMPLATE PBEPARAM_seq_tt[] = { 71static const ASN1_TEMPLATE PBEPARAM_seq_tt[] = {
diff --git a/src/lib/libcrypto/asn1/p5_pbev2.c b/src/lib/libcrypto/asn1/p5_pbev2.c
index 8ee752c020..ebb20c296f 100644
--- a/src/lib/libcrypto/asn1/p5_pbev2.c
+++ b/src/lib/libcrypto/asn1/p5_pbev2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p5_pbev2.c,v 1.31 2024/02/18 15:44:10 tb Exp $ */ 1/* $OpenBSD: p5_pbev2.c,v 1.32 2024/03/02 10:17:37 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999-2004. 3 * project 1999-2004.
4 */ 4 */
@@ -65,6 +65,7 @@
65#include <openssl/x509.h> 65#include <openssl/x509.h>
66 66
67#include "evp_local.h" 67#include "evp_local.h"
68#include "x509_local.h"
68 69
69/* PKCS#5 v2.0 password based encryption structures */ 70/* PKCS#5 v2.0 password based encryption structures */
70 71
diff --git a/src/lib/libcrypto/evp/evp_pbe.c b/src/lib/libcrypto/evp/evp_pbe.c
index 3f1f1ec9a4..a9f5b8fb12 100644
--- a/src/lib/libcrypto/evp/evp_pbe.c
+++ b/src/lib/libcrypto/evp/evp_pbe.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_pbe.c,v 1.44 2024/03/02 10:15:15 tb Exp $ */ 1/* $OpenBSD: evp_pbe.c,v 1.45 2024/03/02 10:17:37 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -70,6 +70,7 @@
70#include "evp_local.h" 70#include "evp_local.h"
71#include "hmac_local.h" 71#include "hmac_local.h"
72#include "pkcs12_local.h" 72#include "pkcs12_local.h"
73#include "x509_local.h"
73 74
74/* Password based encryption (PBE) functions */ 75/* Password based encryption (PBE) functions */
75int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, 76int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h
index fe18202533..bd8497d9c4 100644
--- a/src/lib/libcrypto/x509/x509.h
+++ b/src/lib/libcrypto/x509/x509.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509.h,v 1.103 2023/11/02 20:25:48 tb Exp $ */ 1/* $OpenBSD: x509.h,v 1.104 2024/03/02 10:17:37 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -328,28 +328,11 @@ typedef struct Netscape_spki_st {
328 ASN1_BIT_STRING *signature; 328 ASN1_BIT_STRING *signature;
329} NETSCAPE_SPKI; 329} NETSCAPE_SPKI;
330 330
331/* Password based encryption structure */
332
333typedef struct PBEPARAM_st { 331typedef struct PBEPARAM_st {
334 ASN1_OCTET_STRING *salt; 332 ASN1_OCTET_STRING *salt;
335 ASN1_INTEGER *iter; 333 ASN1_INTEGER *iter;
336} PBEPARAM; 334} PBEPARAM;
337 335
338/* Password based encryption V2 structures */
339
340typedef struct PBE2PARAM_st {
341 X509_ALGOR *keyfunc;
342 X509_ALGOR *encryption;
343} PBE2PARAM;
344
345typedef struct PBKDF2PARAM_st {
346 /* Usually OCTET STRING but could be anything */
347 ASN1_TYPE *salt;
348 ASN1_INTEGER *iter;
349 ASN1_INTEGER *keylength;
350 X509_ALGOR *prf;
351} PBKDF2PARAM;
352
353#ifdef __cplusplus 336#ifdef __cplusplus
354} 337}
355#endif 338#endif
@@ -1033,21 +1016,7 @@ X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk,X509_NAME *name,
1033 ASN1_INTEGER *serial); 1016 ASN1_INTEGER *serial);
1034X509 *X509_find_by_subject(STACK_OF(X509) *sk,X509_NAME *name); 1017X509 *X509_find_by_subject(STACK_OF(X509) *sk,X509_NAME *name);
1035 1018
1036PBEPARAM *PBEPARAM_new(void);
1037void PBEPARAM_free(PBEPARAM *a);
1038PBEPARAM *d2i_PBEPARAM(PBEPARAM **a, const unsigned char **in, long len);
1039int i2d_PBEPARAM(PBEPARAM *a, unsigned char **out);
1040extern const ASN1_ITEM PBEPARAM_it; 1019extern const ASN1_ITEM PBEPARAM_it;
1041PBE2PARAM *PBE2PARAM_new(void);
1042void PBE2PARAM_free(PBE2PARAM *a);
1043PBE2PARAM *d2i_PBE2PARAM(PBE2PARAM **a, const unsigned char **in, long len);
1044int i2d_PBE2PARAM(PBE2PARAM *a, unsigned char **out);
1045extern const ASN1_ITEM PBE2PARAM_it;
1046PBKDF2PARAM *PBKDF2PARAM_new(void);
1047void PBKDF2PARAM_free(PBKDF2PARAM *a);
1048PBKDF2PARAM *d2i_PBKDF2PARAM(PBKDF2PARAM **a, const unsigned char **in, long len);
1049int i2d_PBKDF2PARAM(PBKDF2PARAM *a, unsigned char **out);
1050extern const ASN1_ITEM PBKDF2PARAM_it;
1051 1020
1052int PKCS5_pbe_set0_algor(X509_ALGOR *algor, int alg, int iter, 1021int PKCS5_pbe_set0_algor(X509_ALGOR *algor, int alg, int iter,
1053 const unsigned char *salt, int saltlen); 1022 const unsigned char *salt, int saltlen);
diff --git a/src/lib/libcrypto/x509/x509_local.h b/src/lib/libcrypto/x509/x509_local.h
index f62f5ad57d..1e813797e1 100644
--- a/src/lib/libcrypto/x509/x509_local.h
+++ b/src/lib/libcrypto/x509/x509_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_local.h,v 1.18 2024/01/06 17:37:23 tb Exp $ */ 1/* $OpenBSD: x509_local.h,v 1.19 2024/03/02 10:17:37 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2013. 3 * project 2013.
4 */ 4 */
@@ -360,6 +360,37 @@ int X509_policy_check(const STACK_OF(X509) *certs,
360 const STACK_OF(ASN1_OBJECT) *user_policies, unsigned long flags, 360 const STACK_OF(ASN1_OBJECT) *user_policies, unsigned long flags,
361 X509 **out_current_cert); 361 X509 **out_current_cert);
362 362
363PBEPARAM *PBEPARAM_new(void);
364void PBEPARAM_free(PBEPARAM *a);
365PBEPARAM *d2i_PBEPARAM(PBEPARAM **a, const unsigned char **in, long len);
366int i2d_PBEPARAM(PBEPARAM *a, unsigned char **out);
367
368/* Password based encryption V2 structures */
369typedef struct PBE2PARAM_st {
370 X509_ALGOR *keyfunc;
371 X509_ALGOR *encryption;
372} PBE2PARAM;
373
374PBE2PARAM *PBE2PARAM_new(void);
375void PBE2PARAM_free(PBE2PARAM *a);
376PBE2PARAM *d2i_PBE2PARAM(PBE2PARAM **a, const unsigned char **in, long len);
377int i2d_PBE2PARAM(PBE2PARAM *a, unsigned char **out);
378extern const ASN1_ITEM PBE2PARAM_it;
379
380typedef struct PBKDF2PARAM_st {
381 /* Usually OCTET STRING but could be anything */
382 ASN1_TYPE *salt;
383 ASN1_INTEGER *iter;
384 ASN1_INTEGER *keylength;
385 X509_ALGOR *prf;
386} PBKDF2PARAM;
387
388PBKDF2PARAM *PBKDF2PARAM_new(void);
389void PBKDF2PARAM_free(PBKDF2PARAM *a);
390PBKDF2PARAM *d2i_PBKDF2PARAM(PBKDF2PARAM **a, const unsigned char **in, long len);
391int i2d_PBKDF2PARAM(PBKDF2PARAM *a, unsigned char **out);
392extern const ASN1_ITEM PBKDF2PARAM_it;
393
363__END_HIDDEN_DECLS 394__END_HIDDEN_DECLS
364 395
365#endif /* !HEADER_X509_LOCAL_H */ 396#endif /* !HEADER_X509_LOCAL_H */