summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2023-04-25 19:08:30 +0000
committertb <>2023-04-25 19:08:30 +0000
commit67debf20de785e46126aa900cfe4c5d7fd9ca7d8 (patch)
tree2fe58f7a7b2748b48eeafe260a4331a19642f102 /src/lib
parent53c813a50e9d2ac606f35b1db747f11077d6fa5a (diff)
downloadopenbsd-67debf20de785e46126aa900cfe4c5d7fd9ca7d8.tar.gz
openbsd-67debf20de785e46126aa900cfe4c5d7fd9ca7d8.tar.bz2
openbsd-67debf20de785e46126aa900cfe4c5d7fd9ca7d8.zip
Move low level BIO_new_NDEF API to internal-only
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/asn1/asn1.h18
-rw-r--r--src/lib/libcrypto/asn1/asn1_local.h15
-rw-r--r--src/lib/libcrypto/asn1/bio_ndef.c6
-rw-r--r--src/lib/libcrypto/cms/cms_io.c3
-rw-r--r--src/lib/libcrypto/pkcs7/bio_pk7.c8
-rw-r--r--src/lib/libcrypto/pkcs7/pk7_mime.c4
6 files changed, 29 insertions, 25 deletions
diff --git a/src/lib/libcrypto/asn1/asn1.h b/src/lib/libcrypto/asn1/asn1.h
index 8b224c1535..5be4668be0 100644
--- a/src/lib/libcrypto/asn1/asn1.h
+++ b/src/lib/libcrypto/asn1/asn1.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1.h,v 1.75 2023/04/24 22:12:28 tb Exp $ */ 1/* $OpenBSD: asn1.h,v 1.76 2023/04/25 19:08:30 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 *
@@ -881,10 +881,6 @@ ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in,
881 long len, const ASN1_ITEM *it); 881 long len, const ASN1_ITEM *it);
882int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); 882int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
883 883
884#if !defined(LIBRESSL_NEXT_API) || defined(LIBRESSL_VERSION_NUMBER)
885int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
886#endif
887
888void ASN1_add_oid_module(void); 884void ASN1_add_oid_module(void);
889 885
890ASN1_TYPE *ASN1_generate_nconf(const char *str, CONF *nconf); 886ASN1_TYPE *ASN1_generate_nconf(const char *str, CONF *nconf);
@@ -928,18 +924,6 @@ void ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags);
928 924
929const BIO_METHOD *BIO_f_asn1(void); 925const BIO_METHOD *BIO_f_asn1(void);
930 926
931#if !defined(LIBRESSL_NEXT_API) || defined(LIBRESSL_INTERNAL)
932BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it);
933
934int i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
935 const ASN1_ITEM *it);
936int PEM_write_bio_ASN1_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
937 const char *hdr, const ASN1_ITEM *it);
938int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
939 int ctype_nid, int econt_nid, STACK_OF(X509_ALGOR) *mdalgs,
940 const ASN1_ITEM *it);
941ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it);
942#endif
943int SMIME_crlf_copy(BIO *in, BIO *out, int flags); 927int SMIME_crlf_copy(BIO *in, BIO *out, int flags);
944int SMIME_text(BIO *in, BIO *out); 928int SMIME_text(BIO *in, BIO *out);
945 929
diff --git a/src/lib/libcrypto/asn1/asn1_local.h b/src/lib/libcrypto/asn1/asn1_local.h
index ed40e18ec9..52b8a46aeb 100644
--- a/src/lib/libcrypto/asn1/asn1_local.h
+++ b/src/lib/libcrypto/asn1/asn1_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1_local.h,v 1.1 2022/11/26 16:08:50 tb Exp $ */ 1/* $OpenBSD: asn1_local.h,v 1.2 2023/04/25 19:08:30 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 2006. 3 * project 2006.
4 */ 4 */
@@ -248,4 +248,17 @@ int OPENSSL_gmtime_diff(int *pday, int *psec, const struct tm *from,
248int asn1_time_time_t_to_tm(const time_t *time, struct tm *out_tm); 248int asn1_time_time_t_to_tm(const time_t *time, struct tm *out_tm);
249int asn1_time_tm_to_time_t(const struct tm *tm, time_t *out); 249int asn1_time_tm_to_time_t(const struct tm *tm, time_t *out);
250 250
251int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
252
253BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it);
254
255int i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
256 const ASN1_ITEM *it);
257int PEM_write_bio_ASN1_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
258 const char *hdr, const ASN1_ITEM *it);
259int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
260 int ctype_nid, int econt_nid, STACK_OF(X509_ALGOR) *mdalgs,
261 const ASN1_ITEM *it);
262ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it);
263
251__END_HIDDEN_DECLS 264__END_HIDDEN_DECLS
diff --git a/src/lib/libcrypto/asn1/bio_ndef.c b/src/lib/libcrypto/asn1/bio_ndef.c
index 2aa323a898..d0329ede8f 100644
--- a/src/lib/libcrypto/asn1/bio_ndef.c
+++ b/src/lib/libcrypto/asn1/bio_ndef.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_ndef.c,v 1.21 2023/03/30 14:23:50 tb Exp $ */ 1/* $OpenBSD: bio_ndef.c,v 1.22 2023/04/25 19:08:30 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. 3 * project.
4 */ 4 */
@@ -52,12 +52,14 @@
52 * 52 *
53 */ 53 */
54 54
55#include <stdio.h>
56
55#include <openssl/asn1.h> 57#include <openssl/asn1.h>
56#include <openssl/asn1t.h> 58#include <openssl/asn1t.h>
57#include <openssl/bio.h> 59#include <openssl/bio.h>
58#include <openssl/err.h> 60#include <openssl/err.h>
59 61
60#include <stdio.h> 62#include "asn1_local.h"
61 63
62/* Experimental NDEF ASN1 BIO support routines */ 64/* Experimental NDEF ASN1 BIO support routines */
63 65
diff --git a/src/lib/libcrypto/cms/cms_io.c b/src/lib/libcrypto/cms/cms_io.c
index 685bf6ad7e..ef1bc4bc4d 100644
--- a/src/lib/libcrypto/cms/cms_io.c
+++ b/src/lib/libcrypto/cms/cms_io.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_io.c,v 1.17 2023/04/21 20:36:07 tb Exp $ */ 1/* $OpenBSD: cms_io.c,v 1.18 2023/04/25 19:08:30 tb Exp $ */
2/* 2/*
3 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 3 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
4 * project. 4 * project.
@@ -58,6 +58,7 @@
58#include <openssl/pem.h> 58#include <openssl/pem.h>
59#include <openssl/x509.h> 59#include <openssl/x509.h>
60 60
61#include "asn1_local.h"
61#include "cms_local.h" 62#include "cms_local.h"
62 63
63int 64int
diff --git a/src/lib/libcrypto/pkcs7/bio_pk7.c b/src/lib/libcrypto/pkcs7/bio_pk7.c
index 83cf70fd87..e452293f7f 100644
--- a/src/lib/libcrypto/pkcs7/bio_pk7.c
+++ b/src/lib/libcrypto/pkcs7/bio_pk7.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_pk7.c,v 1.7 2023/02/16 08:38:17 tb Exp $ */ 1/* $OpenBSD: bio_pk7.c,v 1.8 2023/04/25 19:08:30 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. 3 * project.
4 */ 4 */
@@ -52,11 +52,13 @@
52 * 52 *
53 */ 53 */
54 54
55#include <stdio.h>
56
55#include <openssl/asn1.h> 57#include <openssl/asn1.h>
56#include <openssl/pkcs7.h>
57#include <openssl/bio.h> 58#include <openssl/bio.h>
59#include <openssl/pkcs7.h>
58 60
59#include <stdio.h> 61#include "asn1_local.h"
60 62
61/* Streaming encode support for PKCS#7 */ 63/* Streaming encode support for PKCS#7 */
62BIO * 64BIO *
diff --git a/src/lib/libcrypto/pkcs7/pk7_mime.c b/src/lib/libcrypto/pkcs7/pk7_mime.c
index d5bc031e69..cd723d71f5 100644
--- a/src/lib/libcrypto/pkcs7/pk7_mime.c
+++ b/src/lib/libcrypto/pkcs7/pk7_mime.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pk7_mime.c,v 1.15 2023/02/16 08:38:17 tb Exp $ */ 1/* $OpenBSD: pk7_mime.c,v 1.16 2023/04/25 19:08:30 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. 3 * project.
4 */ 4 */
@@ -58,6 +58,8 @@
58#include <openssl/asn1.h> 58#include <openssl/asn1.h>
59#include <openssl/x509.h> 59#include <openssl/x509.h>
60 60
61#include "asn1_local.h"
62
61/* PKCS#7 wrappers round generalised stream and MIME routines */ 63/* PKCS#7 wrappers round generalised stream and MIME routines */
62 64
63int 65int