This commit is contained in:
purplerain 2023-07-06 21:55:14 +00:00
parent f1b2576417
commit 2a351e0cdc
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
347 changed files with 9596 additions and 5486 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: pax.c,v 1.53 2019/06/28 13:34:59 deraadt Exp $ */ /* $OpenBSD: pax.c,v 1.54 2023/07/05 18:45:14 guenther Exp $ */
/* $NetBSD: pax.c,v 1.5 1996/03/26 23:54:20 mrg Exp $ */ /* $NetBSD: pax.c,v 1.5 1996/03/26 23:54:20 mrg Exp $ */
/*- /*-
@ -93,7 +93,7 @@ char *dirptr; /* destination dir in a copy */
char *argv0; /* root of argv[0] */ char *argv0; /* root of argv[0] */
enum op_mode op_mode; /* what program are we acting as? */ enum op_mode op_mode; /* what program are we acting as? */
sigset_t s_mask; /* signal mask for cleanup critical sect */ sigset_t s_mask; /* signal mask for cleanup critical sect */
FILE *listf = stderr; /* file pointer to print file list to */ FILE *listf; /* file pointer to print file list to */
int listfd = STDERR_FILENO; /* fd matching listf, for sighandler output */ int listfd = STDERR_FILENO; /* fd matching listf, for sighandler output */
char *tempfile; /* tempfile to use for mkstemp(3) */ char *tempfile; /* tempfile to use for mkstemp(3) */
char *tempbase; /* basename of tempfile to use for mkstemp(3) */ char *tempbase; /* basename of tempfile to use for mkstemp(3) */
@ -224,6 +224,8 @@ main(int argc, char **argv)
char *tmpdir; char *tmpdir;
size_t tdlen; size_t tdlen;
listf = stderr;
/* /*
* Keep a reference to cwd, so we can always come back home. * Keep a reference to cwd, so we can always come back home.
*/ */

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: ps.1,v 1.129 2022/10/13 21:37:05 jmc Exp $ .\" $OpenBSD: ps.1,v 1.130 2023/07/06 10:07:09 deraadt Exp $
.\" $NetBSD: ps.1,v 1.16 1996/03/21 01:36:28 jtc Exp $ .\" $NetBSD: ps.1,v 1.16 1996/03/21 01:36:28 jtc Exp $
.\" .\"
.\" Copyright (c) 1980, 1990, 1991, 1993, 1994 .\" Copyright (c) 1980, 1990, 1991, 1993, 1994
@ -30,7 +30,7 @@
.\" .\"
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" @(#)ps.1 8.3 (Berkeley) 4/18/94
.\" .\"
.Dd $Mdocdate: October 13 2022 $ .Dd $Mdocdate: July 6 2023 $
.Dt PS 1 .Dt PS 1
.Os .Os
.Sh NAME .Sh NAME
@ -357,6 +357,8 @@ PS_PLEDGE 0x100000 process has called pledge(2)
PS_WXNEEDED 0x00200000 process allowed to violate W^X PS_WXNEEDED 0x00200000 process allowed to violate W^X
PS_EXECPLEDGE 0x00400000 has exec pledges PS_EXECPLEDGE 0x00400000 has exec pledges
PS_ORPHAN 0x00800000 process is on an orphan list PS_ORPHAN 0x00800000 process is on an orphan list
PS_CHROOT 0x01000000 process is chrooted
PS_NOBTCFI 0x02000000 no Branch Target CFI
.Ed .Ed
.It Cm re .It Cm re
Core residency time (in seconds; 127 = infinity). Core residency time (in seconds; 127 = infinity).

View file

@ -70,6 +70,9 @@
./usr/include/c++/v1/__algorithm/pop_heap.h ./usr/include/c++/v1/__algorithm/pop_heap.h
./usr/include/c++/v1/__algorithm/prev_permutation.h ./usr/include/c++/v1/__algorithm/prev_permutation.h
./usr/include/c++/v1/__algorithm/push_heap.h ./usr/include/c++/v1/__algorithm/push_heap.h
./usr/include/c++/v1/__algorithm/ranges_find.h
./usr/include/c++/v1/__algorithm/ranges_find_if.h
./usr/include/c++/v1/__algorithm/ranges_find_if_not.h
./usr/include/c++/v1/__algorithm/remove.h ./usr/include/c++/v1/__algorithm/remove.h
./usr/include/c++/v1/__algorithm/remove_copy.h ./usr/include/c++/v1/__algorithm/remove_copy.h
./usr/include/c++/v1/__algorithm/remove_copy_if.h ./usr/include/c++/v1/__algorithm/remove_copy_if.h

View file

@ -70,6 +70,9 @@
./usr/include/c++/v1/__algorithm/pop_heap.h ./usr/include/c++/v1/__algorithm/pop_heap.h
./usr/include/c++/v1/__algorithm/prev_permutation.h ./usr/include/c++/v1/__algorithm/prev_permutation.h
./usr/include/c++/v1/__algorithm/push_heap.h ./usr/include/c++/v1/__algorithm/push_heap.h
./usr/include/c++/v1/__algorithm/ranges_find.h
./usr/include/c++/v1/__algorithm/ranges_find_if.h
./usr/include/c++/v1/__algorithm/ranges_find_if_not.h
./usr/include/c++/v1/__algorithm/remove.h ./usr/include/c++/v1/__algorithm/remove.h
./usr/include/c++/v1/__algorithm/remove_copy.h ./usr/include/c++/v1/__algorithm/remove_copy.h
./usr/include/c++/v1/__algorithm/remove_copy_if.h ./usr/include/c++/v1/__algorithm/remove_copy_if.h

View file

@ -68,6 +68,9 @@
./usr/include/c++/v1/__algorithm/pop_heap.h ./usr/include/c++/v1/__algorithm/pop_heap.h
./usr/include/c++/v1/__algorithm/prev_permutation.h ./usr/include/c++/v1/__algorithm/prev_permutation.h
./usr/include/c++/v1/__algorithm/push_heap.h ./usr/include/c++/v1/__algorithm/push_heap.h
./usr/include/c++/v1/__algorithm/ranges_find.h
./usr/include/c++/v1/__algorithm/ranges_find_if.h
./usr/include/c++/v1/__algorithm/ranges_find_if_not.h
./usr/include/c++/v1/__algorithm/remove.h ./usr/include/c++/v1/__algorithm/remove.h
./usr/include/c++/v1/__algorithm/remove_copy.h ./usr/include/c++/v1/__algorithm/remove_copy.h
./usr/include/c++/v1/__algorithm/remove_copy_if.h ./usr/include/c++/v1/__algorithm/remove_copy_if.h

View file

@ -68,6 +68,9 @@
./usr/include/c++/v1/__algorithm/pop_heap.h ./usr/include/c++/v1/__algorithm/pop_heap.h
./usr/include/c++/v1/__algorithm/prev_permutation.h ./usr/include/c++/v1/__algorithm/prev_permutation.h
./usr/include/c++/v1/__algorithm/push_heap.h ./usr/include/c++/v1/__algorithm/push_heap.h
./usr/include/c++/v1/__algorithm/ranges_find.h
./usr/include/c++/v1/__algorithm/ranges_find_if.h
./usr/include/c++/v1/__algorithm/ranges_find_if_not.h
./usr/include/c++/v1/__algorithm/remove.h ./usr/include/c++/v1/__algorithm/remove.h
./usr/include/c++/v1/__algorithm/remove_copy.h ./usr/include/c++/v1/__algorithm/remove_copy.h
./usr/include/c++/v1/__algorithm/remove_copy_if.h ./usr/include/c++/v1/__algorithm/remove_copy_if.h

View file

@ -1838,6 +1838,7 @@
./usr/share/man/man4/pwmfan.4 ./usr/share/man/man4/pwmfan.4
./usr/share/man/man4/pwmleds.4 ./usr/share/man/man4/pwmleds.4
./usr/share/man/man4/pwmreg.4 ./usr/share/man/man4/pwmreg.4
./usr/share/man/man4/qccpu.4
./usr/share/man/man4/qcdwusb.4 ./usr/share/man/man4/qcdwusb.4
./usr/share/man/man4/qcgpio.4 ./usr/share/man/man4/qcgpio.4
./usr/share/man/man4/qciic.4 ./usr/share/man/man4/qciic.4

View file

@ -1,6 +1,6 @@
From purplerain@secbsd.org Wed Jun 7 00:00:00 UTC 2023 From purplerain@secbsd.org Thu Jul 6 00:00:00 UTC 2023
Return-Path: root Return-Path: root
Date: Jun 7 00:00:00 UTC 2023 Date: Jul 6 00:00:00 UTC 2023
From: purplerain@secbsd.org (Purple Rain) From: purplerain@secbsd.org (Purple Rain)
To: root To: root
Subject: Welcome to SecBSD 1.3! Subject: Welcome to SecBSD 1.3!

View file

@ -1 +1 @@
# SecBSD 1.3-3cf4eea: Wed Jun 7 00:00:00 UTC 2023 (Quetzalcoatl) # SecBSD 1.3-3c7d048: Thu Jul 6 00:00:00 UTC 2023 (Quetzalcoatl)

View file

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.5 2021/12/17 14:55:43 patrick Exp $ # $OpenBSD: Makefile,v 1.6 2023/07/05 15:34:52 robert Exp $
.include <bsd.own.mk> .include <bsd.own.mk>
@ -135,6 +135,9 @@ STD_HEADERS= \
__algorithm/pop_heap.h \ __algorithm/pop_heap.h \
__algorithm/prev_permutation.h \ __algorithm/prev_permutation.h \
__algorithm/push_heap.h \ __algorithm/push_heap.h \
__algorithm/ranges_find.h \
__algorithm/ranges_find_if.h \
__algorithm/ranges_find_if_not.h \
__algorithm/remove_copy_if.h \ __algorithm/remove_copy_if.h \
__algorithm/remove_copy.h \ __algorithm/remove_copy.h \
__algorithm/remove_if.h \ __algorithm/remove_if.h \

View file

@ -0,0 +1,63 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef _LIBCPP___ALGORITHM_RANGES_FIND_H
#define _LIBCPP___ALGORITHM_RANGES_FIND_H
#include <__algorithm/ranges_find_if.h>
#include <__config>
#include <__functional/identity.h>
#include <__functional/invoke.h>
#include <__functional/ranges_operations.h>
#include <__iterator/concepts.h>
#include <__iterator/projected.h>
#include <__ranges/access.h>
#include <__ranges/concepts.h>
#include <__ranges/dangling.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __find {
struct __fn {
template <input_iterator _Ip, sentinel_for<_Ip> _Sp, class _Tp, class _Proj = identity>
requires indirect_binary_predicate<ranges::equal_to, projected<_Ip, _Proj>, const _Tp*>
_LIBCPP_HIDE_FROM_ABI constexpr
_Ip operator()(_Ip __first, _Sp __last, const _Tp& __value, _Proj __proj = {}) const {
auto __pred = [&](auto&& __e) { return std::forward<decltype(__e)>(__e) == __value; };
return ranges::__find_if_impl(std::move(__first), std::move(__last), __pred, __proj);
}
template <input_range _Rp, class _Tp, class _Proj = identity>
requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Rp>, _Proj>, const _Tp*>
_LIBCPP_HIDE_FROM_ABI constexpr
borrowed_iterator_t<_Rp> operator()(_Rp&& __r, const _Tp& __value, _Proj __proj = {}) const {
auto __pred = [&](auto&& __e) { return std::forward<decltype(__e)>(__e) == __value; };
return ranges::__find_if_impl(ranges::begin(__r), ranges::end(__r), __pred, __proj);
}
};
} // namespace __find
inline namespace __cpo {
inline constexpr auto find = __find::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
#endif // _LIBCPP___ALGORITHM_RANGES_FIND_H

View file

@ -0,0 +1,71 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef _LIBCPP___ALGORITHM_RANGES_FIND_IF_H
#define _LIBCPP___ALGORITHM_RANGES_FIND_IF_H
#include <__config>
#include <__functional/identity.h>
#include <__functional/invoke.h>
#include <__functional/ranges_operations.h>
#include <__iterator/concepts.h>
#include <__iterator/projected.h>
#include <__ranges/access.h>
#include <__ranges/concepts.h>
#include <__ranges/dangling.h>
#include <__utility/move.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
template <class _Ip, class _Sp, class _Pred, class _Proj>
_LIBCPP_HIDE_FROM_ABI static constexpr
_Ip __find_if_impl(_Ip __first, _Sp __last, _Pred& __pred, _Proj& __proj) {
for (; __first != __last; ++__first) {
if (std::invoke(__pred, std::invoke(__proj, *__first)))
break;
}
return __first;
}
namespace __find_if {
struct __fn {
template <input_iterator _Ip, sentinel_for<_Ip> _Sp, class _Proj = identity,
indirect_unary_predicate<projected<_Ip, _Proj>> _Pred>
_LIBCPP_HIDE_FROM_ABI constexpr
_Ip operator()(_Ip __first, _Sp __last, _Pred __pred, _Proj __proj = {}) const {
return ranges::__find_if_impl(std::move(__first), std::move(__last), __pred, __proj);
}
template <input_range _Rp, class _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Rp>, _Proj>> _Pred>
_LIBCPP_HIDE_FROM_ABI constexpr
borrowed_iterator_t<_Rp> operator()(_Rp&& __r, _Pred __pred, _Proj __proj = {}) const {
return ranges::__find_if_impl(ranges::begin(__r), ranges::end(__r), __pred, __proj);
}
};
} // namespace __find_if
inline namespace __cpo {
inline constexpr auto find_if = __find_if::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
#endif // _LIBCPP___ALGORITHM_RANGES_FIND_IF_H

View file

@ -0,0 +1,63 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef _LIBCPP___ALGORITHM_RANGES_FIND_IF_NOT_H
#define _LIBCPP___ALGORITHM_RANGES_FIND_IF_NOT_H
#include <__algorithm/ranges_find_if.h>
#include <__config>
#include <__functional/identity.h>
#include <__functional/invoke.h>
#include <__functional/ranges_operations.h>
#include <__iterator/concepts.h>
#include <__iterator/projected.h>
#include <__ranges/access.h>
#include <__ranges/concepts.h>
#include <__ranges/dangling.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __find_if_not {
struct __fn {
template <input_iterator _Ip, sentinel_for<_Ip> _Sp, class _Proj = identity,
indirect_unary_predicate<projected<_Ip, _Proj>> _Pred>
_LIBCPP_HIDE_FROM_ABI constexpr
_Ip operator()(_Ip __first, _Sp __last, _Pred __pred, _Proj __proj = {}) const {
auto __pred2 = [&](auto&& __e) { return !std::invoke(__pred, std::forward<decltype(__e)>(__e)); };
return ranges::__find_if_impl(std::move(__first), std::move(__last), __pred2, __proj);
}
template <input_range _Rp, class _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Rp>, _Proj>> _Pred>
_LIBCPP_HIDE_FROM_ABI constexpr
borrowed_iterator_t<_Rp> operator()(_Rp&& __r, _Pred __pred, _Proj __proj = {}) const {
auto __pred2 = [&](auto&& __e) { return !std::invoke(__pred, std::forward<decltype(__e)>(__e)); };
return ranges::__find_if_impl(ranges::begin(__r), ranges::end(__r), __pred2, __proj);
}
};
} // namespace __find_if_not
inline namespace __cpo {
inline constexpr auto find_if_not = __find_if_not::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
#endif // _LIBCPP___ALGORITHM_RANGES_FIND_IF_NOT_H

View file

@ -18,6 +18,35 @@
namespace std namespace std
{ {
namespace ranges {
template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity>
requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
constexpr I find(I first, S last, const T& value, Proj proj = {}); // since C++20
template<input_range R, class T, class Proj = identity>
requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*>
constexpr borrowed_iterator_t<R>
find(R&& r, const T& value, Proj proj = {}); // since C++20
template<input_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
constexpr I find_if(I first, S last, Pred pred, Proj proj = {}); // since C++20
template<input_range R, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
constexpr borrowed_iterator_t<R>
find_if(R&& r, Pred pred, Proj proj = {}); // since C++20
template<input_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
constexpr I find_if_not(I first, S last, Pred pred, Proj proj = {}); // since C++20
template<input_range R, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
constexpr borrowed_iterator_t<R>
find_if_not(R&& r, Pred pred, Proj proj = {}); // since C++20
}
template <class InputIterator, class Predicate> template <class InputIterator, class Predicate>
constexpr bool // constexpr in C++20 constexpr bool // constexpr in C++20
all_of(InputIterator first, InputIterator last, Predicate pred); all_of(InputIterator first, InputIterator last, Predicate pred);
@ -720,6 +749,9 @@ template <class BidirectionalIterator, class Compare>
#include <__algorithm/pop_heap.h> #include <__algorithm/pop_heap.h>
#include <__algorithm/prev_permutation.h> #include <__algorithm/prev_permutation.h>
#include <__algorithm/push_heap.h> #include <__algorithm/push_heap.h>
#include <__algorithm/ranges_find.h>
#include <__algorithm/ranges_find_if.h>
#include <__algorithm/ranges_find_if_not.h>
#include <__algorithm/remove.h> #include <__algorithm/remove.h>
#include <__algorithm/remove_copy.h> #include <__algorithm/remove_copy.h>
#include <__algorithm/remove_copy_if.h> #include <__algorithm/remove_copy_if.h>

View file

@ -279,6 +279,9 @@ module std [system] {
module pop_heap { private header "__algorithm/pop_heap.h" } module pop_heap { private header "__algorithm/pop_heap.h" }
module prev_permutation { private header "__algorithm/prev_permutation.h" } module prev_permutation { private header "__algorithm/prev_permutation.h" }
module push_heap { private header "__algorithm/push_heap.h" } module push_heap { private header "__algorithm/push_heap.h" }
module ranges_find { private header "__algorithm/ranges_find.h" }
module ranges_find_if { private header "__algorithm/ranges_find_if.h" }
module ranges_find_if_not { private header "__algorithm/ranges_find_if_not.h" }
module remove { private header "__algorithm/remove.h" } module remove { private header "__algorithm/remove.h" }
module remove_copy { private header "__algorithm/remove_copy.h" } module remove_copy { private header "__algorithm/remove_copy.h" }
module remove_copy_if { private header "__algorithm/remove_copy_if.h" } module remove_copy_if { private header "__algorithm/remove_copy_if.h" }

View file

@ -833,6 +833,11 @@ This is the default.
Create a Create a
.Dv PT_OPENBSD_WXNEEDED .Dv PT_OPENBSD_WXNEEDED
segment. segment.
.Pp
.It Cm nobtcfi
Create a
.Dv PT_OPENBSD_NOBTCFI
segment.
.El .El
.El .El
.Sh IMPLEMENTATION NOTES .Sh IMPLEMENTATION NOTES

View file

@ -1318,6 +1318,9 @@ struct elf_obj_tdata
/* TRUE if output program should be marked to request W^X permission */ /* TRUE if output program should be marked to request W^X permission */
bfd_boolean wxneeded; bfd_boolean wxneeded;
/* TRUE if output program should be marked to stop branch target CFI enforcement */
bfd_boolean nobtcfi;
/* Symbol version definitions in external objects. */ /* Symbol version definitions in external objects. */
Elf_Internal_Verdef *verdef; Elf_Internal_Verdef *verdef;

View file

@ -1102,6 +1102,7 @@ get_segment_type (unsigned int p_type)
case PT_GNU_RELRO: pt = "RELRO"; break; case PT_GNU_RELRO: pt = "RELRO"; break;
case PT_OPENBSD_RANDOMIZE: pt = "OPENBSD_RANDOMIZE"; break; case PT_OPENBSD_RANDOMIZE: pt = "OPENBSD_RANDOMIZE"; break;
case PT_OPENBSD_WXNEEDED: pt = "OPENBSD_WXNEEDED"; break; case PT_OPENBSD_WXNEEDED: pt = "OPENBSD_WXNEEDED"; break;
case PT_OPENBSD_NOBTCFI: pt = "OPENBSD_NOBTCFI"; break;
case PT_OPENBSD_BOOTDATA: pt = "OPENBSD_BOOTDATA"; break; case PT_OPENBSD_BOOTDATA: pt = "OPENBSD_BOOTDATA"; break;
case PT_OPENBSD_MUTABLE: pt = "OPENBSD_MUTABLE"; break; case PT_OPENBSD_MUTABLE: pt = "OPENBSD_MUTABLE"; break;
default: pt = NULL; break; default: pt = NULL; break;
@ -2646,6 +2647,10 @@ bfd_section_from_phdr (bfd *abfd, Elf_Internal_Phdr *hdr, int index)
return _bfd_elf_make_section_from_phdr (abfd, hdr, index, return _bfd_elf_make_section_from_phdr (abfd, hdr, index,
"openbsd_wxneeded"); "openbsd_wxneeded");
case PT_OPENBSD_NOBTCFI:
return _bfd_elf_make_section_from_phdr (abfd, hdr, index,
"openbsd_nobtcfi");
case PT_OPENBSD_MUTABLE: case PT_OPENBSD_MUTABLE:
return _bfd_elf_make_section_from_phdr (abfd, hdr, index, return _bfd_elf_make_section_from_phdr (abfd, hdr, index,
"openbsd_mutable"); "openbsd_mutable");
@ -3981,7 +3986,22 @@ map_sections_to_segments (bfd *abfd)
goto error_return; goto error_return;
m->next = NULL; m->next = NULL;
m->p_type = PT_OPENBSD_WXNEEDED; m->p_type = PT_OPENBSD_WXNEEDED;
m->p_flags = 1; m->p_flags = PF_X;
m->p_flags_valid = 1;
*pm = m;
pm = &m->next;
}
if (elf_tdata (abfd)->nobtcfi)
{
amt = sizeof (struct elf_segment_map);
m = bfd_zalloc (abfd, amt);
if (m == NULL)
goto error_return;
m->next = NULL;
m->p_type = PT_OPENBSD_NOBTCFI;
m->p_flags = PF_X;
m->p_flags_valid = 1; m->p_flags_valid = 1;
*pm = m; *pm = m;
@ -4800,6 +4820,12 @@ get_program_header_size (bfd *abfd)
++segs; ++segs;
} }
if (elf_tdata (abfd)->nobtcfi)
{
/* We need a PT_OPENBSD_NOBTCFI segment. */
++segs;
}
for (s = abfd->sections; s != NULL; s = s->next) for (s = abfd->sections; s != NULL; s = s->next)
{ {
if ((s->flags & SEC_LOAD) != 0 if ((s->flags & SEC_LOAD) != 0

View file

@ -21,7 +21,7 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */ 02110-1301, USA. */
/* The difference between readelf and objdump: /* The difference between readelf and objdump:
Both programs are capable of displaying the contents of ELF format files, Both programs are capable of displaying the contents of ELF format files,
@ -40,7 +40,7 @@
There is also the case that readelf can provide more information about an There is also the case that readelf can provide more information about an
ELF file than is provided by objdump. In particular it can display DWARF ELF file than is provided by objdump. In particular it can display DWARF
debugging information which (at the moment) objdump cannot. */ debugging information which (at the moment) objdump cannot. */
#include <assert.h> #include <assert.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -976,7 +976,7 @@ slurp_relr_relocs (FILE *file,
while ((val >>= 1) != 0) while ((val >>= 1) != 0)
{ {
addr += 4; addr += 4;
if (val & 1) if (val & 1)
{ {
rels[j].r_offset = addr; rels[j].r_offset = addr;
rels[j].r_info = ELF32_R_INFO(0, type); rels[j].r_info = ELF32_R_INFO(0, type);
@ -1041,7 +1041,7 @@ slurp_relr_relocs (FILE *file,
while ((val >>= 1) != 0) while ((val >>= 1) != 0)
{ {
addr += 8; addr += 8;
if (val & 1) if (val & 1)
{ {
rels[j].r_offset = addr; rels[j].r_offset = addr;
rels[j].r_info = ELF64_R_INFO(0, type); rels[j].r_info = ELF64_R_INFO(0, type);
@ -2278,7 +2278,7 @@ get_machine_flags (unsigned e_flags, unsigned e_machine)
char const *isa = _("unknown"); char const *isa = _("unknown");
char const *mac = _("unknown mac"); char const *mac = _("unknown mac");
char const *additional = NULL; char const *additional = NULL;
switch (e_flags & EF_M68K_ISA_MASK) switch (e_flags & EF_M68K_ISA_MASK)
{ {
case EF_M68K_ISA_A_NODIV: case EF_M68K_ISA_A_NODIV:
@ -2712,6 +2712,8 @@ get_segment_type (unsigned long p_type)
return "OPENBSD_BOOTDATA"; return "OPENBSD_BOOTDATA";
case PT_OPENBSD_MUTABLE: case PT_OPENBSD_MUTABLE:
return "OPENBSD_MUTABLE"; return "OPENBSD_MUTABLE";
case PT_OPENBSD_NOBTCFI:
return "OPENBSD_NOBTCFI";
default: default:
if ((p_type >= PT_LOPROC) && (p_type <= PT_HIPROC)) if ((p_type >= PT_LOPROC) && (p_type <= PT_HIPROC))

View file

@ -270,6 +270,9 @@ struct bfd_link_info
/* TRUE if output program should be marked to request W^X permission */ /* TRUE if output program should be marked to request W^X permission */
unsigned int wxneeded: 1; unsigned int wxneeded: 1;
/* TRUE if output program should be marked to stop branch target CFI enforcement */
unsigned int nobtcfi: 1;
/* TRUE if ok to have version with no definition. */ /* TRUE if ok to have version with no definition. */
unsigned int allow_undefined_version: 1; unsigned int allow_undefined_version: 1;

View file

@ -186,7 +186,7 @@
#define EM_BLACKFIN 106 /* ADI Blackfin */ #define EM_BLACKFIN 106 /* ADI Blackfin */
#define EM_ALTERA_NIOS2 113 /* Altera Nios II soft-core processor */ #define EM_ALTERA_NIOS2 113 /* Altera Nios II soft-core processor */
#define EM_CRX 114 /* National Semiconductor CRX */ #define EM_CRX 114 /* National Semiconductor CRX */
#define EM_AARCH64 183 #define EM_AARCH64 183
#define EM_RISCV 243 #define EM_RISCV 243
/* If it is necessary to assign new unofficial EM_* values, please pick large /* If it is necessary to assign new unofficial EM_* values, please pick large
@ -313,6 +313,7 @@
#define PT_OPENBSD_RANDOMIZE 0x65a3dbe6 /* Fill with random data. */ #define PT_OPENBSD_RANDOMIZE 0x65a3dbe6 /* Fill with random data. */
#define PT_OPENBSD_WXNEEDED 0x65a3dbe7 /* Program does W^X violations */ #define PT_OPENBSD_WXNEEDED 0x65a3dbe7 /* Program does W^X violations */
#define PT_OPENBSD_NOBTCFI 0x65a3dbe8 /* no branch target CFI */
#define PT_OPENBSD_BOOTDATA 0x65a41be6 /* Section for boot arguments */ #define PT_OPENBSD_BOOTDATA 0x65a41be6 /* Section for boot arguments */
#define PT_OPENBSD_MUTABLE 0x65a3dbe5 /* Like bss, but not immutable */ #define PT_OPENBSD_MUTABLE 0x65a3dbe5 /* Like bss, but not immutable */

View file

@ -105,8 +105,8 @@ gld${EMULATION_NAME}_split_lib_name (name, pmaj, pmin)
*pmaj = -1; *pmaj = -1;
*pmin = -1; *pmin = -1;
if (strncmp(lib, "lib", 3) == 0) if (strncmp(lib, "lib", 3) == 0)
lib += 3; lib += 3;
s = lib; s = lib;
@ -136,7 +136,7 @@ gld${EMULATION_NAME}_split_lib_name (name, pmaj, pmin)
s += 3; s += 3;
} }
/* lib[name].so.[M].[N] */ /* lib[name].so.[M].[N] */
/* s ^ */ /* s ^ */
s += 1; s += 1;
@ -173,12 +173,12 @@ gld${EMULATION_NAME}_search_dir_needed (dirlist, filename)
char *fnam, *fnam_alloc, *lib; char *fnam, *fnam_alloc, *lib;
char *found = NULL; char *found = NULL;
int maj = -1, min = -1; int maj = -1, min = -1;
dlist_alloc = dlist = xstrdup(dirlist); dlist_alloc = dlist = xstrdup(dirlist);
fnam_alloc = fnam = xstrdup(filename); fnam_alloc = fnam = xstrdup(filename);
lib = gld${EMULATION_NAME}_split_lib_name(fnam, &maj, &min); lib = gld${EMULATION_NAME}_split_lib_name(fnam, &maj, &min);
while (lib != NULL && found == NULL) while (lib != NULL && found == NULL)
{ {
dir = strsep(&dlist, ":"); dir = strsep(&dlist, ":");
@ -188,7 +188,7 @@ gld${EMULATION_NAME}_search_dir_needed (dirlist, filename)
continue; /* skip dirlist of ...::... */ continue; /* skip dirlist of ...::... */
found = gld${EMULATION_NAME}_search_dir(dir, lib, maj, min); found = gld${EMULATION_NAME}_search_dir(dir, lib, maj, min);
} }
free(dlist_alloc); free(dlist_alloc);
free(fnam_alloc); free(fnam_alloc);
return found; return found;
@ -221,7 +221,7 @@ gld${EMULATION_NAME}_search_dir (dirname, filename, req_maj, req_min)
if (dir == NULL) if (dir == NULL)
return NULL; return NULL;
dirnamelen = strlen (dirname); dirnamelen = strlen (dirname);
while ((entry = readdir (dir)) != NULL) while ((entry = readdir (dir)) != NULL)
{ {
const char *s; const char *s;
@ -263,13 +263,13 @@ gld${EMULATION_NAME}_search_dir (dirname, filename, req_maj, req_min)
found_maj = strtoul (entry->d_name + 7 + len, &eptr, 10); found_maj = strtoul (entry->d_name + 7 + len, &eptr, 10);
/* do not support libN.so. or libN.so.X */ /* do not support libN.so. or libN.so.X */
if (*eptr != '.' || ((entry->d_name + 3 + len) == eptr)) if (*eptr != '.' || ((entry->d_name + 3 + len) == eptr))
continue; continue;
found_min = strtoul (eptr+1, &eptr1, 10); found_min = strtoul (eptr+1, &eptr1, 10);
/* do not support libN.so.X. or libN.so.X.Y.[anything] */ /* do not support libN.so.X. or libN.so.X.Y.[anything] */
if (*eptr1 != '\0' || (eptr+1 == eptr1)) if (*eptr1 != '\0' || (eptr+1 == eptr1))
continue; continue;
} }
@ -2206,6 +2206,8 @@ cat >>e${EMULATION_NAME}.c <<EOF
link_info.relro = FALSE; link_info.relro = FALSE;
else if (strcmp (optarg, "wxneeded") == 0) else if (strcmp (optarg, "wxneeded") == 0)
link_info.wxneeded = TRUE; link_info.wxneeded = TRUE;
else if (strcmp (optarg, "nobtcfi") == 0)
link_info.nobtcfi = TRUE;
else if (strcmp (optarg, "notext") == 0) else if (strcmp (optarg, "notext") == 0)
link_info.allow_textrel = TRUE; link_info.allow_textrel = TRUE;
else if (strcmp (optarg, "text") == 0) else if (strcmp (optarg, "text") == 0)

View file

@ -1019,6 +1019,11 @@ Marks the executable with a @code{PT_OPENBSD_WXNEEDED} segment header,
indicating it is expected to perform W^X violating operations later indicating it is expected to perform W^X violating operations later
(such as calling mprotect(2) or mmap(2) with both PROT_WRITE and PROT_EXEC). (such as calling mprotect(2) or mmap(2) with both PROT_WRITE and PROT_EXEC).
@item nobtcfi
Marks the executable with a @code{PT_OPENBSD_NOBTCFI} segment header,
indicating it is expected the binary is missing BTI/IBT instructions and
thus the system should not enforce them as required.
@end table @end table
Other keywords are ignored for Solaris compatibility. Other keywords are ignored for Solaris compatibility.

View file

@ -1095,6 +1095,8 @@ phdr_type:
$$ = exp_intop (0x65a3dbe6); $$ = exp_intop (0x65a3dbe6);
else if (strcmp (s, "PT_OPENBSD_WXNEEDED") == 0) else if (strcmp (s, "PT_OPENBSD_WXNEEDED") == 0)
$$ = exp_intop (0x65a3dbe7); $$ = exp_intop (0x65a3dbe7);
else if (strcmp (s, "PT_OPENBSD_NOBTCFI") == 0)
$$ = exp_intop (0x65a3dbe8);
else if (strcmp (s, "PT_OPENBSD_BOOTDATA") == 0) else if (strcmp (s, "PT_OPENBSD_BOOTDATA") == 0)
$$ = exp_intop (0x65a41be6); $$ = exp_intop (0x65a41be6);
else if (strcmp (s, "PT_OPENBSD_MUTABLE") == 0) else if (strcmp (s, "PT_OPENBSD_MUTABLE") == 0)

View file

@ -14,7 +14,7 @@ take more than one argument. Thus, a comma terminates the argument of
a unary operator, but merely separates the arguments of a list a unary operator, but merely separates the arguments of a list
operator. A unary operator generally provides scalar context to its operator. A unary operator generally provides scalar context to its
argument, while a list operator may provide either scalar or list argument, while a list operator may provide either scalar or list
contexts for its arguments. If it does both, scalar arguments contexts for its arguments. If it does both, scalar arguments
come first and list argument follow, and there can only ever come first and list argument follow, and there can only ever
be one such list argument. For instance, splice() has three scalar be one such list argument. For instance, splice() has three scalar
arguments followed by a list, whereas gethostbyname() has four scalar arguments followed by a list, whereas gethostbyname() has four scalar
@ -30,7 +30,7 @@ Commas should separate literal elements of the LIST.
Any function in the list below may be used either with or without Any function in the list below may be used either with or without
parentheses around its arguments. (The syntax descriptions omit the parentheses around its arguments. (The syntax descriptions omit the
parentheses.) If you use parentheses, the simple but occasionally parentheses.) If you use parentheses, the simple but occasionally
surprising rule is this: It I<looks> like a function, therefore it I<is> a surprising rule is this: It I<looks> like a function, therefore it I<is> a
function, and precedence doesn't matter. Otherwise it's a list function, and precedence doesn't matter. Otherwise it's a list
operator or unary operator, and precedence does matter. Whitespace operator or unary operator, and precedence does matter. Whitespace
@ -175,7 +175,7 @@ C<break>, C<continue>, C<default>, C<given>, C<when>
Except for C<continue>, these are available only if you enable the Except for C<continue>, these are available only if you enable the
C<"switch"> feature or use the C<CORE::> prefix. C<"switch"> feature or use the C<CORE::> prefix.
See L<feature> and L<perlsyn/"Switch statements">. See L<feature> and L<perlsyn/"Switch statements">.
Alternately, include a C<use v5.10> or later to the current scope. In Perl Alternately, include a C<use v5.10> or later to the current scope. In Perl
5.14 and earlier, C<continue> required the C<"switch"> feature, like the 5.14 and earlier, C<continue> required the C<"switch"> feature, like the
other keywords. other keywords.
@ -250,7 +250,7 @@ C<gmtime>, C<localtime>, C<time>, C<times>
=item Functions new in perl5 =item Functions new in perl5
X<perl5> X<perl5>
C<abs>, C<bless>, C<break>, C<chomp>, C<chr>, C<continue>, C<default>, C<abs>, C<bless>, C<break>, C<chomp>, C<chr>, C<continue>, C<default>,
C<exists>, C<formline>, C<given>, C<glob>, C<import>, C<lc>, C<lcfirst>, C<exists>, C<formline>, C<given>, C<glob>, C<import>, C<lc>, C<lcfirst>,
C<lock>, C<map>, C<my>, C<no>, C<our>, C<prototype>, C<qr//>, C<qw//>, C<qx//>, C<lock>, C<map>, C<my>, C<no>, C<our>, C<prototype>, C<qr//>, C<qw//>, C<qx//>,
C<readline>, C<readpipe>, C<ref>, C<sub>*, C<sysopen>, C<tie>, C<tied>, C<uc>, C<readline>, C<readpipe>, C<ref>, C<sub>*, C<sysopen>, C<tie>, C<tied>, C<uc>,
@ -297,7 +297,7 @@ L<perlport> and other available platform-specific documentation.
=head2 Alphabetical Listing of Perl Functions =head2 Alphabetical Listing of Perl Functions
=over =over
=item -X FILEHANDLE =item -X FILEHANDLE
X<-r>X<-w>X<-x>X<-o>X<-R>X<-W>X<-X>X<-O>X<-e>X<-z>X<-s>X<-f>X<-d>X<-l>X<-p> X<-r>X<-w>X<-x>X<-o>X<-R>X<-W>X<-X>X<-O>X<-e>X<-z>X<-s>X<-f>X<-d>X<-l>X<-p>
@ -310,7 +310,7 @@ X<-S>X<-b>X<-c>X<-t>X<-u>X<-g>X<-k>X<-T>X<-B>X<-M>X<-A>X<-C>
=item -X =item -X
A file test, where X is one of the letters listed below. This unary A file test, where X is one of the letters listed below. This unary
operator takes one argument, either a filename, a filehandle, or a dirhandle, operator takes one argument, either a filename, a filehandle, or a dirhandle,
and tests the associated file to see if something is true about it. If the and tests the associated file to see if something is true about it. If the
argument is omitted, tests C<$_>, except for C<-t>, which tests STDIN. argument is omitted, tests C<$_>, except for C<-t>, which tests STDIN.
Unless otherwise documented, it returns C<1> for true and C<''> for false, or Unless otherwise documented, it returns C<1> for true and C<''> for false, or
@ -454,7 +454,7 @@ If VALUE is omitted, uses C<$_>.
=item accept NEWSOCKET,GENERICSOCKET =item accept NEWSOCKET,GENERICSOCKET
X<accept> X<accept>
Accepts an incoming socket connect, just as accept(2) Accepts an incoming socket connect, just as accept(2)
does. Returns the packed address if it succeeded, false otherwise. does. Returns the packed address if it succeeded, false otherwise.
See the example in L<perlipc/"Sockets: Client/Server Communication">. See the example in L<perlipc/"Sockets: Client/Server Communication">.
@ -894,7 +894,7 @@ X<chr> X<character> X<ASCII> X<Unicode>
Returns the character represented by that NUMBER in the character set. Returns the character represented by that NUMBER in the character set.
For example, C<chr(65)> is C<"A"> in either ASCII or Unicode, and For example, C<chr(65)> is C<"A"> in either ASCII or Unicode, and
chr(0x263a) is a Unicode smiley face. chr(0x263a) is a Unicode smiley face.
Negative values give the Unicode replacement character (chr(0xfffd)), Negative values give the Unicode replacement character (chr(0xfffd)),
except under the L<bytes> pragma, where the low eight bits of the value except under the L<bytes> pragma, where the low eight bits of the value
@ -1069,7 +1069,7 @@ to create the digest is visible as part of the digest. This ensures
crypt() will hash the new string with the same salt as the digest. crypt() will hash the new string with the same salt as the digest.
This allows your code to work with the standard L<crypt|/crypt> and This allows your code to work with the standard L<crypt|/crypt> and
with more exotic implementations. In other words, assume with more exotic implementations. In other words, assume
nothing about the returned string itself nor about how many bytes nothing about the returned string itself nor about how many bytes
of SALT may matter. of SALT may matter.
Traditionally the result is a string of 13 bytes: two first bytes of Traditionally the result is a string of 13 bytes: two first bytes of
@ -1147,7 +1147,7 @@ sdbm(3).
If you don't have write access to the DBM file, you can only read hash If you don't have write access to the DBM file, you can only read hash
variables, not set them. If you want to test whether you can write, variables, not set them. If you want to test whether you can write,
either use file tests or try setting a dummy hash entry inside an C<eval> either use file tests or try setting a dummy hash entry inside an C<eval>
to trap the error. to trap the error.
Note that functions such as C<keys> and C<values> may return huge lists Note that functions such as C<keys> and C<values> may return huge lists
@ -1300,7 +1300,7 @@ And so do these:
delete @ARRAY[0 .. $#ARRAY]; delete @ARRAY[0 .. $#ARRAY];
But both are slower than assigning the empty list But both are slower than assigning the empty list
or undefining %HASH or @ARRAY, which is the customary or undefining %HASH or @ARRAY, which is the customary
way to empty out an aggregate: way to empty out an aggregate:
%HASH = (); # completely empty %HASH %HASH = (); # completely empty %HASH
@ -1383,7 +1383,7 @@ You can also call C<die> with a reference argument, and if this is trapped
within an C<eval>, C<$@> contains that reference. This permits more within an C<eval>, C<$@> contains that reference. This permits more
elaborate exception handling using objects that maintain arbitrary state elaborate exception handling using objects that maintain arbitrary state
about the exception. Such a scheme is sometimes preferable to matching about the exception. Such a scheme is sometimes preferable to matching
particular string values of C<$@> with regular expressions. Because C<$@> particular string values of C<$@> with regular expressions. Because C<$@>
is a global variable and C<eval> may be used within object implementations, is a global variable and C<eval> may be used within object implementations,
be careful that analyzing the error object doesn't replace the reference in be careful that analyzing the error object doesn't replace the reference in
the global variable. It's easiest to make a local copy of the reference the global variable. It's easiest to make a local copy of the reference
@ -1410,7 +1410,7 @@ does its deed, by setting the C<$SIG{__DIE__}> hook. The associated
handler is called with the error text and can change the error handler is called with the error text and can change the error
message, if it sees fit, by calling C<die> again. See message, if it sees fit, by calling C<die> again. See
L<perlvar/%SIG> for details on setting C<%SIG> entries, and L<perlvar/%SIG> for details on setting C<%SIG> entries, and
L<"eval BLOCK"> for some examples. Although this feature was L<"eval BLOCK"> for some examples. Although this feature was
to be run only right before your program was to exit, this is not to be run only right before your program was to exit, this is not
currently so: the C<$SIG{__DIE__}> hook is currently called currently so: the C<$SIG{__DIE__}> hook is currently called
even inside eval()ed blocks/strings! If one wants the hook to do even inside eval()ed blocks/strings! If one wants the hook to do
@ -1595,7 +1595,7 @@ and if you haven't set C<@ARGV>, will read input from C<STDIN>;
see L<perlop/"I/O Operators">. see L<perlop/"I/O Operators">.
In a C<< while (<>) >> loop, C<eof> or C<eof(ARGV)> can be used to In a C<< while (<>) >> loop, C<eof> or C<eof(ARGV)> can be used to
detect the end of each file, whereas C<eof()> will detect the end detect the end of each file, whereas C<eof()> will detect the end
of the very last file only. Examples: of the very last file only. Examples:
# reset line numbering on each input file # reset line numbering on each input file
@ -1616,7 +1616,7 @@ of the very last file only. Examples:
} }
Practical hint: you almost never need to use C<eof> in Perl, because the Practical hint: you almost never need to use C<eof> in Perl, because the
input operators typically return C<undef> when they run out of data or input operators typically return C<undef> when they run out of data or
encounter an error. encounter an error.
=item eval EXPR =item eval EXPR
@ -1663,8 +1663,8 @@ the BLOCK.
In both forms, the value returned is the value of the last expression In both forms, the value returned is the value of the last expression
evaluated inside the mini-program; a return statement may be also used, just evaluated inside the mini-program; a return statement may be also used, just
as with subroutines. The expression providing the return value is evaluated as with subroutines. The expression providing the return value is evaluated
in void, scalar, or list context, depending on the context of the C<eval> in void, scalar, or list context, depending on the context of the C<eval>
itself. See L</wantarray> for more on how the evaluation context can be itself. See L</wantarray> for more on how the evaluation context can be
determined. determined.
If there is a syntax error or runtime error, or a C<die> statement is If there is a syntax error or runtime error, or a C<die> statement is
@ -1754,7 +1754,7 @@ normally you I<would> like to use double quotes, except that in this
particular situation, you can just use symbolic references instead, as particular situation, you can just use symbolic references instead, as
in case 6. in case 6.
Before Perl 5.14, the assignment to C<$@> occurred before restoration Before Perl 5.14, the assignment to C<$@> occurred before restoration
of localised variables, which means that for your code to run on older of localised variables, which means that for your code to run on older
versions, a temporary is required if you want to mask some but not all versions, a temporary is required if you want to mask some but not all
errors: errors:
@ -2053,7 +2053,7 @@ Two potentially non-obvious but traditional C<flock> semantics are
that it waits indefinitely until the lock is granted, and that its locks that it waits indefinitely until the lock is granted, and that its locks
are B<merely advisory>. Such discretionary locks are more flexible, but are B<merely advisory>. Such discretionary locks are more flexible, but
offer fewer guarantees. This means that programs that do not also use offer fewer guarantees. This means that programs that do not also use
C<flock> may modify files locked with C<flock>. See L<perlport>, C<flock> may modify files locked with C<flock>. See L<perlport>,
your port's specific documentation, and your system-specific local manpages your port's specific documentation, and your system-specific local manpages
for details. It's best to assume traditional behavior if you're writing for details. It's best to assume traditional behavior if you're writing
portable programs. (But if you're not, you should as always feel perfectly portable programs. (But if you're not, you should as always feel perfectly
@ -2305,7 +2305,7 @@ X<getpwuid> X<getgrgid> X<getservbyname> X<gethostbyaddr> X<getnetbyaddr>
X<getprotobynumber> X<getservbyport> X<getpwent> X<getgrent> X<gethostent> X<getprotobynumber> X<getservbyport> X<getpwent> X<getgrent> X<gethostent>
X<getnetent> X<getprotoent> X<getservent> X<setpwent> X<setgrent> X<sethostent> X<getnetent> X<getprotoent> X<getservent> X<setpwent> X<setgrent> X<sethostent>
X<setnetent> X<setprotoent> X<setservent> X<endpwent> X<endgrent> X<endhostent> X<setnetent> X<setprotoent> X<setservent> X<endpwent> X<endgrent> X<endhostent>
X<endnetent> X<endprotoent> X<endservent> X<endnetent> X<endprotoent> X<endservent>
=item getgrnam NAME =item getgrnam NAME
@ -2409,7 +2409,7 @@ field may be $change or $age, fields that have to do with password
aging. In some systems the $comment field may be $class. The $expire aging. In some systems the $comment field may be $class. The $expire
field, if present, encodes the expiration period of the account or the field, if present, encodes the expiration period of the account or the
password. For the availability and the exact meaning of these fields password. For the availability and the exact meaning of these fields
in your system, please consult getpwnam(3) and your system's in your system, please consult getpwnam(3) and your system's
F<pwd.h> file. You can also find out from within Perl what your F<pwd.h> file. You can also find out from within Perl what your
$quota and $comment fields mean and whether you have the $expire field $quota and $comment fields mean and whether you have the $expire field
by using the C<Config> module and the values C<d_pwquota>, C<d_pwage>, by using the C<Config> module and the values C<d_pwquota>, C<d_pwage>,
@ -2564,7 +2564,7 @@ EXPR is omitted, C<$_> is used. The C<< <*.c> >> operator is discussed in
more detail in L<perlop/"I/O Operators">. more detail in L<perlop/"I/O Operators">.
Note that C<glob> splits its arguments on whitespace and treats Note that C<glob> splits its arguments on whitespace and treats
each segment as separate pattern. As such, C<glob("*.c *.h")> each segment as separate pattern. As such, C<glob("*.c *.h")>
matches all files with a F<.c> or F<.h> extension. The expression matches all files with a F<.c> or F<.h> extension. The expression
C<glob(".* *")> matches all files in the current working directory. C<glob(".* *")> matches all files in the current working directory.
If you want to glob filenames that might contain whitespace, you'll If you want to glob filenames that might contain whitespace, you'll
@ -3329,7 +3329,7 @@ message queue ID into variable VAR with a maximum message size of
SIZE. Note that when a message is received, the message type as a SIZE. Note that when a message is received, the message type as a
native long integer will be the first thing in VAR, followed by the native long integer will be the first thing in VAR, followed by the
actual message. This packing may be opened with C<unpack("l! a*")>. actual message. This packing may be opened with C<unpack("l! a*")>.
Taints the variable. Returns true if successful, false Taints the variable. Returns true if successful, false
on error. See also L<perlipc/"SysV IPC"> and the documentation for on error. See also L<perlipc/"SysV IPC"> and the documentation for
C<IPC::SysV> and C<IPC::SysV::Msg>. C<IPC::SysV> and C<IPC::SysV::Msg>.
@ -3430,11 +3430,11 @@ in octal), use sprintf() or printf():
$oct_perm_str = sprintf "%o", $perms; $oct_perm_str = sprintf "%o", $perms;
The oct() function is commonly used when a string such as C<644> needs The oct() function is commonly used when a string such as C<644> needs
to be converted into a file mode, for example. Although Perl to be converted into a file mode, for example. Although Perl
automatically converts strings into numbers as needed, this automatic automatically converts strings into numbers as needed, this automatic
conversion assumes base 10. conversion assumes base 10.
Leading white space is ignored without warning, as too are any trailing Leading white space is ignored without warning, as too are any trailing
non-digits, such as a decimal point (C<oct> only handles non-negative non-digits, such as a decimal point (C<oct> only handles non-negative
integers, not negative integers or floating point). integers, not negative integers or floating point).
@ -3454,12 +3454,12 @@ FILEHANDLE.
Simple examples to open a file for reading: Simple examples to open a file for reading:
open(my $fh, "<", "input.txt") open(my $fh, "<", "input.txt")
or die "cannot open < input.txt: $!"; or die "cannot open < input.txt: $!";
and for writing: and for writing:
open(my $fh, ">", "output.txt") open(my $fh, ">", "output.txt")
or die "cannot open > output.txt: $!"; or die "cannot open > output.txt: $!";
(The following is a comprehensive reference to open(): for a gentler (The following is a comprehensive reference to open(): for a gentler
@ -3473,7 +3473,7 @@ considered a symbolic reference, so C<use strict "refs"> should I<not> be
in effect.) in effect.)
If EXPR is omitted, the global (package) scalar variable of the same If EXPR is omitted, the global (package) scalar variable of the same
name as the FILEHANDLE contains the filename. (Note that lexical name as the FILEHANDLE contains the filename. (Note that lexical
variables--those declared with C<my> or C<state>--will not work for this variables--those declared with C<my> or C<state>--will not work for this
purpose; so if you're using C<my> or C<state>, specify EXPR in your purpose; so if you're using C<my> or C<state>, specify EXPR in your
call to open.) call to open.)
@ -3488,7 +3488,7 @@ created if necessary.
You can put a C<+> in front of the C<< > >> or C<< < >> to You can put a C<+> in front of the C<< > >> or C<< < >> to
indicate that you want both read and write access to the file; thus indicate that you want both read and write access to the file; thus
C<< +< >> is almost always preferred for read/write updates--the C<< +< >> is almost always preferred for read/write updates--the
C<< +> >> mode would clobber the file first. You cant usually use C<< +> >> mode would clobber the file first. You cant usually use
either read-write mode for updating textfiles, since they have either read-write mode for updating textfiles, since they have
variable-length records. See the B<-i> switch in L<perlrun> for a variable-length records. See the B<-i> switch in L<perlrun> for a
@ -3522,7 +3522,7 @@ C<open> with more than three arguments for non-pipe modes is not yet
defined, but experimental "layers" may give extra LIST arguments defined, but experimental "layers" may give extra LIST arguments
meaning. meaning.
In the two-argument (and one-argument) form, opening C<< <- >> In the two-argument (and one-argument) form, opening C<< <- >>
or C<-> opens STDIN and opening C<< >- >> opens STDOUT. or C<-> opens STDIN and opening C<< >- >> opens STDOUT.
You may (and usually should) use the three-argument form of open to specify You may (and usually should) use the three-argument form of open to specify
@ -3553,12 +3553,12 @@ like Unix, Mac OS, and Plan 9, that end lines with a single
character and encode that character in C as C<"\n"> do not character and encode that character in C as C<"\n"> do not
need C<binmode>. The rest need it. need C<binmode>. The rest need it.
When opening a file, it's seldom a good idea to continue When opening a file, it's seldom a good idea to continue
if the request failed, so C<open> is frequently used with if the request failed, so C<open> is frequently used with
C<die>. Even if C<die> won't do what you want (say, in a CGI script, C<die>. Even if C<die> won't do what you want (say, in a CGI script,
where you want to format a suitable error message (but there are where you want to format a suitable error message (but there are
modules that can help with that problem)) always check modules that can help with that problem)) always check
the return value from opening a file. the return value from opening a file.
As a special case the three-argument form with a read/write mode and the third As a special case the three-argument form with a read/write mode and the third
argument being C<undef>: argument being C<undef>:
@ -3708,7 +3708,7 @@ and looking for the C<useperlio=> line. If C<useperlio> is C<define>, you
have PerlIO; otherwise you don't. have PerlIO; otherwise you don't.
If you open a pipe on the command C<-> (that is, specify either C<|-> or C<-|> If you open a pipe on the command C<-> (that is, specify either C<|-> or C<-|>
with the one- or two-argument forms of C<open>), with the one- or two-argument forms of C<open>),
an implicit C<fork> is done, so C<open> returns twice: in the parent an implicit C<fork> is done, so C<open> returns twice: in the parent
process it returns the pid process it returns the pid
of the child process, and in the child process it returns (a defined) C<0>. of the child process, and in the child process it returns (a defined) C<0>.
@ -3721,7 +3721,7 @@ For example, use either
or or
$child_pid = open(TO_KID, "|-") // die "can't fork: $!"; $child_pid = open(TO_KID, "|-") // die "can't fork: $!";
followed by followed by
if ($child_pid) { if ($child_pid) {
# am the parent: # am the parent:
@ -3732,7 +3732,7 @@ followed by
# am the child; use STDIN/STDOUT normally # am the child; use STDIN/STDOUT normally
... ...
exit; exit;
} }
The filehandle behaves normally for the parent, but I/O to that The filehandle behaves normally for the parent, but I/O to that
filehandle is piped from/to the STDOUT/STDIN of the child process. filehandle is piped from/to the STDOUT/STDIN of the child process.
@ -3757,7 +3757,7 @@ The following blocks are more or less equivalent:
The last two examples in each block show the pipe as "list form", which is The last two examples in each block show the pipe as "list form", which is
not yet supported on all platforms. A good rule of thumb is that if not yet supported on all platforms. A good rule of thumb is that if
your platform has a real C<fork()> (in other words, if your platform is your platform has a real C<fork()> (in other words, if your platform is
Unix, including Linux and MacOS X), you can use the list form. You would Unix, including Linux and MacOS X), you can use the list form. You would
want to use the list form of the pipe so you can pass literal arguments want to use the list form of the pipe so you can pass literal arguments
to the command without risk of the shell interpreting any shell metacharacters to the command without risk of the shell interpreting any shell metacharacters
in them. However, this also bars you from opening pipes to commands in them. However, this also bars you from opening pipes to commands
@ -3855,7 +3855,7 @@ close that happens when the refcount on C<handle> does not
properly detect and report failures. I<Always> close the handle properly detect and report failures. I<Always> close the handle
yourself and inspect the return value. yourself and inspect the return value.
close($handle) close($handle)
|| warn "close failed: $!"; || warn "close failed: $!";
See L</seek> for some details about mixing reading and writing. See L</seek> for some details about mixing reading and writing.
@ -3966,7 +3966,7 @@ given by the TEMPLATE. The resulting string is the concatenation of
the converted values. Typically, each converted value looks the converted values. Typically, each converted value looks
like its machine-level representation. For example, on 32-bit machines like its machine-level representation. For example, on 32-bit machines
an integer may be represented by a sequence of 4 bytes, which will in an integer may be represented by a sequence of 4 bytes, which will in
Perl be presented as a string that's 4 characters long. Perl be presented as a string that's 4 characters long.
See L<perlpacktut> for an introduction to this function. See L<perlpacktut> for an introduction to this function.
@ -4063,13 +4063,13 @@ TEMPLATE (the second column lists letters for which the modifier is valid):
< sSiIlLqQ Force little-endian byte-order on the type. < sSiIlLqQ Force little-endian byte-order on the type.
jJfFdDpP (The "little end" touches the construct.) jJfFdDpP (The "little end" touches the construct.)
The C<< > >> and C<< < >> modifiers can also be used on C<()> groups The C<< > >> and C<< < >> modifiers can also be used on C<()> groups
to force a particular byte-order on all components in that group, to force a particular byte-order on all components in that group,
including all its subgroups. including all its subgroups.
The following rules apply: The following rules apply:
=over =over
=item * =item *
@ -4081,21 +4081,21 @@ C<B>, C<h>, C<H>, C<@>, C<.>, C<x>, C<X>, and C<P>, where it means
something else, described below. Supplying a C<*> for the repeat count something else, described below. Supplying a C<*> for the repeat count
instead of a number means to use however many items are left, except for: instead of a number means to use however many items are left, except for:
=over =over
=item * =item *
C<@>, C<x>, and C<X>, where it is equivalent to C<0>. C<@>, C<x>, and C<X>, where it is equivalent to C<0>.
=item * =item *
<.>, where it means relative to the start of the string. <.>, where it means relative to the start of the string.
=item * =item *
C<u>, where it is equivalent to 1 (or 45, which here is equivalent). C<u>, where it is equivalent to 1 (or 45, which here is equivalent).
=back =back
One can replace a numeric repeat count with a template letter enclosed in One can replace a numeric repeat count with a template letter enclosed in
brackets to use the packed byte length of the bracketed template for the brackets to use the packed byte length of the bracketed template for the
@ -4117,7 +4117,7 @@ of the innermost C<()> group.
When used with C<.>, the repeat count determines the starting position to When used with C<.>, the repeat count determines the starting position to
calculate the value offset as follows: calculate the value offset as follows:
=over =over
=item * =item *
@ -4137,7 +4137,7 @@ bigger then the group level.
=back =back
The repeat count for C<u> is interpreted as the maximal number of bytes The repeat count for C<u> is interpreted as the maximal number of bytes
to encode per line of output, with 0, 1 and 2 replaced by 45. The repeat to encode per line of output, with 0, 1 and 2 replaced by 45. The repeat
count should not be more than 65. count should not be more than 65.
=item * =item *
@ -4174,7 +4174,7 @@ at the end. Similarly during unpacking, "extra" bits are ignored.
If the input string is longer than needed, remaining characters are ignored. If the input string is longer than needed, remaining characters are ignored.
A C<*> for the repeat count uses all characters of the input field. A C<*> for the repeat count uses all characters of the input field.
On unpacking, bits are converted to a string of C<0>s and C<1>s. On unpacking, bits are converted to a string of C<0>s and C<1>s.
=item * =item *
@ -4188,7 +4188,7 @@ bits of the input character, i.e., on C<ord($char)%16>. In particular,
characters C<"0"> and C<"1"> generate nybbles 0 and 1, as do bytes characters C<"0"> and C<"1"> generate nybbles 0 and 1, as do bytes
C<"\000"> and C<"\001">. For characters C<"a".."f"> and C<"A".."F">, the result C<"\000"> and C<"\001">. For characters C<"a".."f"> and C<"A".."F">, the result
is compatible with the usual hexadecimal digits, so that C<"a"> and is compatible with the usual hexadecimal digits, so that C<"a"> and
C<"A"> both generate the nybble C<0xA==10>. Use only these specific hex C<"A"> both generate the nybble C<0xA==10>. Use only these specific hex
characters with this format. characters with this format.
Starting from the beginning of the template to pack(), each pair Starting from the beginning of the template to pack(), each pair
@ -4250,7 +4250,7 @@ an explicit repeat count for pack, the packed string is adjusted to that
length. For example: length. For example:
This code: gives this result: This code: gives this result:
unpack("W/a", "\004Gurusamy") ("Guru") unpack("W/a", "\004Gurusamy") ("Guru")
unpack("a3/A A*", "007 Bond J ") (" Bond", "J") unpack("a3/A A*", "007 Bond J ") (" Bond", "J")
unpack("a3 x2 /A A*", "007: Bond, J.") ("Bond, J", ".") unpack("a3 x2 /A A*", "007: Bond, J.") ("Bond, J", ".")
@ -4274,10 +4274,10 @@ exactly 32 bits, although the native C<long> as seen by the local C compiler
may be larger. This is mainly an issue on 64-bit platforms. You can may be larger. This is mainly an issue on 64-bit platforms. You can
see whether using C<!> makes any difference this way: see whether using C<!> makes any difference this way:
printf "format s is %d, s! is %d\n", printf "format s is %d, s! is %d\n",
length pack("s"), length pack("s!"); length pack("s"), length pack("s!");
printf "format l is %d, l! is %d\n", printf "format l is %d, l! is %d\n",
length pack("l"), length pack("l!"); length pack("l"), length pack("l!");
@ -4302,7 +4302,7 @@ or programmatically via the C<Config> module:
print $Config{longsize}, "\n"; print $Config{longsize}, "\n";
print $Config{longlongsize}, "\n"; print $Config{longlongsize}, "\n";
C<$Config{longlongsize}> is undefined on systems without C<$Config{longlongsize}> is undefined on systems without
long long support. long long support.
=item * =item *
@ -4318,7 +4318,7 @@ handled by the CPU registers) into bytes as
Basically, Intel and VAX CPUs are little-endian, while everybody else, Basically, Intel and VAX CPUs are little-endian, while everybody else,
including Motorola m68k/88k, PPC, Sparc, HP PA, Power, and Cray, are including Motorola m68k/88k, PPC, Sparc, HP PA, Power, and Cray, are
big-endian. Alpha and MIPS can be either: Digital/Compaq uses (well, used) big-endian. Alpha and MIPS can be either: Digital/Compaq uses (well, used)
them in little-endian mode, but SGI/Cray uses them in big-endian mode. them in little-endian mode, but SGI/Cray uses them in big-endian mode.
The names I<big-endian> and I<little-endian> are comic references to the The names I<big-endian> and I<little-endian> are comic references to the
@ -4334,7 +4334,7 @@ Some systems may have even weirder byte orders such as
You can determine your system endianness with this incantation: You can determine your system endianness with this incantation:
printf("%#02x ", $_) for unpack("W*", pack L=>0x12345678); printf("%#02x ", $_) for unpack("W*", pack L=>0x12345678);
The byteorder on the platform where Perl was built is also available The byteorder on the platform where Perl was built is also available
via L<Config>: via L<Config>:
@ -4349,36 +4349,36 @@ or from the command line:
Byteorders C<"1234"> and C<"12345678"> are little-endian; C<"4321"> Byteorders C<"1234"> and C<"12345678"> are little-endian; C<"4321">
and C<"87654321"> are big-endian. and C<"87654321"> are big-endian.
For portably packed integers, either use the formats C<n>, C<N>, C<v>, For portably packed integers, either use the formats C<n>, C<N>, C<v>,
and C<V> or else use the C<< > >> and C<< < >> modifiers described and C<V> or else use the C<< > >> and C<< < >> modifiers described
immediately below. See also L<perlport>. immediately below. See also L<perlport>.
=item * =item *
Starting with Perl 5.9.2, integer and floating-point formats, along with Starting with Perl 5.9.2, integer and floating-point formats, along with
the C<p> and C<P> formats and C<()> groups, may all be followed by the the C<p> and C<P> formats and C<()> groups, may all be followed by the
C<< > >> or C<< < >> endianness modifiers to respectively enforce big- C<< > >> or C<< < >> endianness modifiers to respectively enforce big-
or little-endian byte-order. These modifiers are especially useful or little-endian byte-order. These modifiers are especially useful
given how C<n>, C<N>, C<v>, and C<V> don't cover signed integers, given how C<n>, C<N>, C<v>, and C<V> don't cover signed integers,
64-bit integers, or floating-point values. 64-bit integers, or floating-point values.
Here are some concerns to keep in mind when using an endianness modifier: Here are some concerns to keep in mind when using an endianness modifier:
=over =over
=item * =item *
Exchanging signed integers between different platforms works only Exchanging signed integers between different platforms works only
when all platforms store them in the same format. Most platforms store when all platforms store them in the same format. Most platforms store
signed integers in two's-complement notation, so usually this is not an issue. signed integers in two's-complement notation, so usually this is not an issue.
=item * =item *
The C<< > >> or C<< < >> modifiers can only be used on floating-point The C<< > >> or C<< < >> modifiers can only be used on floating-point
formats on big- or little-endian machines. Otherwise, attempting to formats on big- or little-endian machines. Otherwise, attempting to
use them raises an exception. use them raises an exception.
=item * =item *
Forcing big- or little-endian byte-order on floating-point values for Forcing big- or little-endian byte-order on floating-point values for
data exchange can work only if all platforms use the same data exchange can work only if all platforms use the same
@ -4388,7 +4388,7 @@ to use C<< > >> or C<< < >> on floating-point values can be useful,
but also dangerous if you don't know exactly what you're doing. but also dangerous if you don't know exactly what you're doing.
It is not a general way to portably store floating-point values. It is not a general way to portably store floating-point values.
=item * =item *
When using C<< > >> or C<< < >> on a C<()> group, this affects When using C<< > >> or C<< < >> on a C<()> group, this affects
all types inside the group that accept byte-order modifiers, all types inside the group that accept byte-order modifiers,
@ -4412,7 +4412,7 @@ If you know I<exactly> what you're doing, you can use the C<< > >> or C<< < >>
modifiers to force big- or little-endian byte-order on floating-point values. modifiers to force big- or little-endian byte-order on floating-point values.
Because Perl uses doubles (or long doubles, if configured) internally for Because Perl uses doubles (or long doubles, if configured) internally for
all numeric calculation, converting from double into float and thence all numeric calculation, converting from double into float and thence
to double again loses precision, so C<unpack("f", pack("f", $foo)>) to double again loses precision, so C<unpack("f", pack("f", $foo)>)
will not in general equal $foo. will not in general equal $foo.
@ -4421,25 +4421,25 @@ will not in general equal $foo.
Pack and unpack can operate in two modes: character mode (C<C0> mode) where Pack and unpack can operate in two modes: character mode (C<C0> mode) where
the packed string is processed per character, and UTF-8 mode (C<U0> mode) the packed string is processed per character, and UTF-8 mode (C<U0> mode)
where the packed string is processed in its UTF-8-encoded Unicode form on where the packed string is processed in its UTF-8-encoded Unicode form on
a byte-by-byte basis. Character mode is the default unless the format string a byte-by-byte basis. Character mode is the default unless the format string
starts with C<U>. You can always switch mode mid-format with an explicit starts with C<U>. You can always switch mode mid-format with an explicit
C<C0> or C<U0> in the format. This mode remains in effect until the next C<C0> or C<U0> in the format. This mode remains in effect until the next
mode change, or until the end of the C<()> group it (directly) applies to. mode change, or until the end of the C<()> group it (directly) applies to.
Using C<C0> to get Unicode characters while using C<U0> to get I<non>-Unicode Using C<C0> to get Unicode characters while using C<U0> to get I<non>-Unicode
bytes is not necessarily obvious. Probably only the first of these bytes is not necessarily obvious. Probably only the first of these
is what you want: is what you want:
$ perl -CS -E 'say "\x{3B1}\x{3C9}"' | $ perl -CS -E 'say "\x{3B1}\x{3C9}"' |
perl -CS -ne 'printf "%v04X\n", $_ for unpack("C0A*", $_)' perl -CS -ne 'printf "%v04X\n", $_ for unpack("C0A*", $_)'
03B1.03C9 03B1.03C9
$ perl -CS -E 'say "\x{3B1}\x{3C9}"' | $ perl -CS -E 'say "\x{3B1}\x{3C9}"' |
perl -CS -ne 'printf "%v02X\n", $_ for unpack("U0A*", $_)' perl -CS -ne 'printf "%v02X\n", $_ for unpack("U0A*", $_)'
CE.B1.CF.89 CE.B1.CF.89
$ perl -CS -E 'say "\x{3B1}\x{3C9}"' | $ perl -CS -E 'say "\x{3B1}\x{3C9}"' |
perl -C0 -ne 'printf "%v02X\n", $_ for unpack("C0A*", $_)' perl -C0 -ne 'printf "%v02X\n", $_ for unpack("C0A*", $_)'
CE.B1.CF.89 CE.B1.CF.89
$ perl -CS -E 'say "\x{3B1}\x{3C9}"' | $ perl -CS -E 'say "\x{3B1}\x{3C9}"' |
perl -C0 -ne 'printf "%v02X\n", $_ for unpack("U0A*", $_)' perl -C0 -ne 'printf "%v02X\n", $_ for unpack("U0A*", $_)'
C3.8E.C2.B1.C3.8F.C2.89 C3.8E.C2.B1.C3.8F.C2.89
@ -4450,7 +4450,7 @@ C<pack>/C<unpack> as a substitute for the L<Encode> module.
You must yourself do any alignment or padding by inserting, for example, You must yourself do any alignment or padding by inserting, for example,
enough C<"x">es while packing. There is no way for pack() and unpack() enough C<"x">es while packing. There is no way for pack() and unpack()
to know where characters are going to or coming from, so they to know where characters are going to or coming from, so they
handle their output and input as flat sequences of characters. handle their output and input as flat sequences of characters.
=item * =item *
@ -4472,7 +4472,7 @@ characters. For example, to pack() or unpack() a C structure like
struct { struct {
char c; /* one signed, 8-bit character */ char c; /* one signed, 8-bit character */
double d; double d;
char cc[2]; char cc[2];
} }
@ -4602,9 +4602,9 @@ like C<STDOUT>, C<ARGV>, C<ENV>, and the punctuation variables.
A package statement affects dynamic variables only, including those A package statement affects dynamic variables only, including those
you've used C<local> on, but I<not> lexical variables, which are created you've used C<local> on, but I<not> lexical variables, which are created
with C<my>, C<state>, or C<our>. Typically it would be the first with C<my>, C<state>, or C<our>. Typically it would be the first
declaration in a file included by C<require> or C<use>. You can switch into a declaration in a file included by C<require> or C<use>. You can switch into a
package in more than one place, since this only determines which default package in more than one place, since this only determines which default
symbol table the compiler uses for the rest of that block. You can refer to symbol table the compiler uses for the rest of that block. You can refer to
identifiers in other packages than the current one by prefixing the identifier identifiers in other packages than the current one by prefixing the identifier
with the package name and a double colon, as in C<$SomePack::var> with the package name and a double colon, as in C<$SomePack::var>
@ -4637,7 +4637,7 @@ L<perlipc/"Bidirectional Communication with Another Process">
for examples of such things. for examples of such things.
On systems that support a close-on-exec flag on files, that flag is set On systems that support a close-on-exec flag on files, that flag is set
on all newly opened file descriptors whose C<fileno>s are I<higher> than on all newly opened file descriptors whose C<fileno>s are I<higher> than
the current value of $^F (by default 2 for C<STDERR>). See L<perlvar/$^F>. the current value of $^F (by default 2 for C<STDERR>). See L<perlvar/$^F>.
=item __PACKAGE__ =item __PACKAGE__
@ -4887,7 +4887,7 @@ X<read> X<file, read>
Attempts to read LENGTH I<characters> of data into variable SCALAR Attempts to read LENGTH I<characters> of data into variable SCALAR
from the specified FILEHANDLE. Returns the number of characters from the specified FILEHANDLE. Returns the number of characters
actually read, C<0> at end of file, or undef if there was an error (in actually read, C<0> at end of file, or undef if there was an error (in
the latter case C<$!> is also set). SCALAR will be grown or shrunk the latter case C<$!> is also set). SCALAR will be grown or shrunk
so that the last character actually read is the last character of the so that the last character actually read is the last character of the
scalar after the read. scalar after the read.
@ -5039,7 +5039,7 @@ X<redo>
The C<redo> command restarts the loop block without evaluating the The C<redo> command restarts the loop block without evaluating the
conditional again. The C<continue> block, if any, is not executed. If conditional again. The C<continue> block, if any, is not executed. If
the LABEL is omitted, the command refers to the innermost enclosing the LABEL is omitted, the command refers to the innermost enclosing
loop. Programs that want to lie to themselves about what was just input loop. Programs that want to lie to themselves about what was just input
normally use this command: normally use this command:
# a simpleminded Pascal comment stripper # a simpleminded Pascal comment stripper
@ -5239,14 +5239,14 @@ Subroutine references are the simplest case. When the inclusion system
walks through @INC and encounters a subroutine, this subroutine gets walks through @INC and encounters a subroutine, this subroutine gets
called with two parameters, the first a reference to itself, and the called with two parameters, the first a reference to itself, and the
second the name of the file to be included (e.g., "F<Foo/Bar.pm>"). The second the name of the file to be included (e.g., "F<Foo/Bar.pm>"). The
subroutine should return either nothing or else a list of up to three subroutine should return either nothing or else a list of up to three
values in the following order: values in the following order:
=over =over
=item 1 =item 1
A filehandle, from which the file will be read. A filehandle, from which the file will be read.
=item 2 =item 2
@ -5268,7 +5268,7 @@ reference to the subroutine itself is passed in as C<$_[0]>.
If an empty list, C<undef>, or nothing that matches the first 3 values above If an empty list, C<undef>, or nothing that matches the first 3 values above
is returned, then C<require> looks at the remaining elements of @INC. is returned, then C<require> looks at the remaining elements of @INC.
Note that this filehandle must be a real filehandle (strictly a typeglob Note that this filehandle must be a real filehandle (strictly a typeglob
or reference to a typeglob, whether blessed or unblessed); tied filehandles or reference to a typeglob, whether blessed or unblessed); tied filehandles
will be ignored and processing will stop there. will be ignored and processing will stop there.
If the hook is an array reference, its first element must be a subroutine If the hook is an array reference, its first element must be a subroutine
@ -5325,7 +5325,7 @@ variables and reset C<??> searches so that they work again. The
expression is interpreted as a list of single characters (hyphens expression is interpreted as a list of single characters (hyphens
allowed for ranges). All variables and arrays beginning with one of allowed for ranges). All variables and arrays beginning with one of
those letters are reset to their pristine state. If the expression is those letters are reset to their pristine state. If the expression is
omitted, one-match searches (C<?pattern?>) are reset to match again. omitted, one-match searches (C<?pattern?>) are reset to match again.
Only resets variables or searches in the current package. Always returns Only resets variables or searches in the current package. Always returns
1. Examples: 1. Examples:
@ -5529,9 +5529,9 @@ X<select> X<filehandle, default>
Returns the currently selected filehandle. If FILEHANDLE is supplied, Returns the currently selected filehandle. If FILEHANDLE is supplied,
sets the new current default filehandle for output. This has two sets the new current default filehandle for output. This has two
effects: first, a C<write> or a C<print> without a filehandle effects: first, a C<write> or a C<print> without a filehandle
default to this FILEHANDLE. Second, references to variables related to default to this FILEHANDLE. Second, references to variables related to
output will refer to this output channel. output will refer to this output channel.
For example, to set the top-of-form format for more than one For example, to set the top-of-form format for more than one
output channel, you might do the following: output channel, you might do the following:
@ -5654,7 +5654,7 @@ X<semop>
Calls the System V IPC function semop(2) for semaphore operations Calls the System V IPC function semop(2) for semaphore operations
such as signalling and waiting. OPSTRING must be a packed array of such as signalling and waiting. OPSTRING must be a packed array of
semop structures. Each semop structure can be generated with semop structures. Each semop structure can be generated with
C<pack("s!3", $semnum, $semop, $semflag)>. The length of OPSTRING C<pack("s!3", $semnum, $semop, $semflag)>. The length of OPSTRING
implies the number of semaphore operations. Returns true if implies the number of semaphore operations. Returns true if
successful, false on error. As an example, the successful, false on error. As an example, the
following code waits on semaphore $semnum of semaphore id $semid: following code waits on semaphore $semnum of semaphore id $semid:
@ -5828,8 +5828,8 @@ X<sleep> X<pause>
=item sleep =item sleep
Causes the script to sleep for (integer) EXPR seconds, or forever if no Causes the script to sleep for (integer) EXPR seconds, or forever if no
argument is given. Returns the integer number of seconds actually slept. argument is given. Returns the integer number of seconds actually slept.
May be interrupted if the process receives a signal such as C<SIGALRM>. May be interrupted if the process receives a signal such as C<SIGALRM>.
@ -5909,7 +5909,7 @@ In scalar context, the behaviour of C<sort()> is undefined.
If SUBNAME or BLOCK is omitted, C<sort>s in standard string comparison If SUBNAME or BLOCK is omitted, C<sort>s in standard string comparison
order. If SUBNAME is specified, it gives the name of a subroutine order. If SUBNAME is specified, it gives the name of a subroutine
that returns an integer less than, equal to, or greater than C<0>, that returns an integer less than, equal to, or greater than C<0>,
depending on how the elements of the list are to be ordered. (The depending on how the elements of the list are to be ordered. (The
C<< <=> >> and C<cmp> operators are extremely useful in such routines.) C<< <=> >> and C<cmp> operators are extremely useful in such routines.)
SUBNAME may be a scalar variable name (unsubscripted), in which case SUBNAME may be a scalar variable name (unsubscripted), in which case
the value provides the name of (or a reference to) the actual the value provides the name of (or a reference to) the actual
@ -5960,32 +5960,32 @@ Examples:
# sort lexically # sort lexically
@articles = sort @files; @articles = sort @files;
# same thing, but with explicit sort routine # same thing, but with explicit sort routine
@articles = sort {$a cmp $b} @files; @articles = sort {$a cmp $b} @files;
# now case-insensitively # now case-insensitively
@articles = sort {uc($a) cmp uc($b)} @files; @articles = sort {uc($a) cmp uc($b)} @files;
# same thing in reversed order # same thing in reversed order
@articles = sort {$b cmp $a} @files; @articles = sort {$b cmp $a} @files;
# sort numerically ascending # sort numerically ascending
@articles = sort {$a <=> $b} @files; @articles = sort {$a <=> $b} @files;
# sort numerically descending # sort numerically descending
@articles = sort {$b <=> $a} @files; @articles = sort {$b <=> $a} @files;
# this sorts the %age hash by value instead of key # this sorts the %age hash by value instead of key
# using an in-line function # using an in-line function
@eldest = sort { $age{$b} <=> $age{$a} } keys %age; @eldest = sort { $age{$b} <=> $age{$a} } keys %age;
# sort using explicit subroutine name # sort using explicit subroutine name
sub byage { sub byage {
$age{$a} <=> $age{$b}; # presuming numeric $age{$a} <=> $age{$b}; # presuming numeric
} }
@sortedclass = sort byage @class; @sortedclass = sort byage @class;
sub backwards { $b cmp $a } sub backwards { $b cmp $a }
@harry = qw(dog cat x Cain Abel); @harry = qw(dog cat x Cain Abel);
@george = qw(gone chased yz Punished Axed); @george = qw(gone chased yz Punished Axed);
@ -6033,14 +6033,14 @@ Examples:
# as a sort subroutine (including other package's subroutines) # as a sort subroutine (including other package's subroutines)
package other; package other;
sub backwards ($$) { $_[1] cmp $_[0]; } # $a and $b are not set here sub backwards ($$) { $_[1] cmp $_[0]; } # $a and $b are not set here
package main; package main;
@new = sort other::backwards @old; @new = sort other::backwards @old;
# guarantee stability, regardless of algorithm # guarantee stability, regardless of algorithm
use sort 'stable'; use sort 'stable';
@new = sort { substr($a, 3, 5) cmp substr($b, 3, 5) } @old; @new = sort { substr($a, 3, 5) cmp substr($b, 3, 5) } @old;
# force use of mergesort (not portable outside Perl 5.8) # force use of mergesort (not portable outside Perl 5.8)
use sort '_mergesort'; # note discouraging _ use sort '_mergesort'; # note discouraging _
@new = sort { substr($a, 3, 5) cmp substr($b, 3, 5) } @old; @new = sort { substr($a, 3, 5) cmp substr($b, 3, 5) } @old;
@ -6273,8 +6273,8 @@ For example:
Perl does its own C<sprintf> formatting: it emulates the C Perl does its own C<sprintf> formatting: it emulates the C
function sprintf(3), but doesn't use it except for floating-point function sprintf(3), but doesn't use it except for floating-point
numbers, and even then only standard modifiers are allowed. numbers, and even then only standard modifiers are allowed.
Non-standard extensions in your local sprintf(3) are Non-standard extensions in your local sprintf(3) are
therefore unavailable from Perl. therefore unavailable from Perl.
Unlike C<printf>, C<sprintf> does not do what you probably mean when you Unlike C<printf>, C<sprintf> does not do what you probably mean when you
@ -6430,7 +6430,7 @@ For example:
printf '<%.1e>', 10; # prints "<1.0e+01>" printf '<%.1e>', 10; # prints "<1.0e+01>"
For "g" and "G", this specifies the maximum number of digits to show, For "g" and "G", this specifies the maximum number of digits to show,
including those prior to the decimal point and those after it; for including those prior to the decimal point and those after it; for
example: example:
# These examples are subject to system-specific variation. # These examples are subject to system-specific variation.
@ -6501,7 +6501,7 @@ as supported by the compiler used to build Perl:
hh interpret integer as C type "char" or "unsigned char" hh interpret integer as C type "char" or "unsigned char"
on Perl 5.14 or later on Perl 5.14 or later
h interpret integer as C type "short" or "unsigned short" h interpret integer as C type "short" or "unsigned short"
j interpret integer as C type "intmax_t" on Perl 5.14 j interpret integer as C type "intmax_t" on Perl 5.14
or later, and only with a C99 compiler (unportable) or later, and only with a C99 compiler (unportable)
l interpret integer as C type "long" or "unsigned long" l interpret integer as C type "long" or "unsigned long"
q, L, or ll interpret integer as C type "long long", "unsigned long long", q, L, or ll interpret integer as C type "long long", "unsigned long long",
@ -6511,7 +6511,7 @@ as supported by the compiler used to build Perl:
As of 5.14, none of these raises an exception if they are not supported on As of 5.14, none of these raises an exception if they are not supported on
your platform. However, if warnings are enabled, a warning of the your platform. However, if warnings are enabled, a warning of the
C<printf> warning class is issued on an unsupported conversion flag. C<printf> warning class is issued on an unsupported conversion flag.
Should you instead prefer an exception, do this: Should you instead prefer an exception, do this:
use warnings FATAL => "printf"; use warnings FATAL => "printf";
@ -6678,7 +6678,7 @@ X<stat> X<file, status> X<ctime>
=item stat =item stat
Returns a 13-element list giving the status info for a file, either Returns a 13-element list giving the status info for a file, either
the file opened via FILEHANDLE or DIRHANDLE, or named by EXPR. If EXPR is the file opened via FILEHANDLE or DIRHANDLE, or named by EXPR. If EXPR is
omitted, it stats C<$_> (not C<_>!). Returns the empty list if C<stat> fails. Typically omitted, it stats C<$_> (not C<_>!). Returns the empty list if C<stat> fails. Typically
used as follows: used as follows:
@ -6821,7 +6821,7 @@ lexical variables that are reinitialized each time their enclosing block
is entered. is entered.
See L<perlsub/"Persistent Private Variables"> for details. See L<perlsub/"Persistent Private Variables"> for details.
C<state> variables are enabled only when the C<use feature "state"> pragma C<state> variables are enabled only when the C<use feature "state"> pragma
is in effect, unless the keyword is written as C<CORE::state>. is in effect, unless the keyword is written as C<CORE::state>.
See also L<feature>. See also L<feature>.
@ -7216,7 +7216,7 @@ possible failure modes by inspecting C<$?> like this:
Alternatively, you may inspect the value of C<${^CHILD_ERROR_NATIVE}> Alternatively, you may inspect the value of C<${^CHILD_ERROR_NATIVE}>
with the C<W*()> calls from the POSIX module. with the C<W*()> calls from the POSIX module.
When C<system>'s arguments are executed indirectly by the shell, When C<system>'s arguments are executed indirectly by the shell,
results and return codes are subject to its quirks. results and return codes are subject to its quirks.
See L<perlop/"`STRING`"> and L</exec> for details. See L<perlop/"`STRING`"> and L</exec> for details.
@ -7489,7 +7489,7 @@ even if you tell C<sysopen> to create a file with permissions C<0777>,
if your umask is C<0022>, then the file will actually be created with if your umask is C<0022>, then the file will actually be created with
permissions C<0755>. If your C<umask> were C<0027> (group can't permissions C<0755>. If your C<umask> were C<0027> (group can't
write; others can't read, write, or execute), then passing write; others can't read, write, or execute), then passing
C<sysopen> C<0666> would create a file with mode C<0640> (because C<sysopen> C<0666> would create a file with mode C<0640> (because
C<0666 &~ 027> is C<0640>). C<0666 &~ 027> is C<0640>).
Here's some advice: supply a creation mode of C<0666> for regular Here's some advice: supply a creation mode of C<0666> for regular
@ -7503,7 +7503,7 @@ kept private: mail files, web browser cookies, I<.rhosts> files, and
so on. so on.
If umask(2) is not implemented on your system and you are trying to If umask(2) is not implemented on your system and you are trying to
restrict access for I<yourself> (i.e., C<< (EXPR & 0700) > 0 >>), restrict access for I<yourself> (i.e., C<< (EXPR & 0700) > 0 >>),
raises an exception. If umask(2) is not implemented and you are raises an exception. If umask(2) is not implemented and you are
not trying to restrict access for yourself, returns C<undef>. not trying to restrict access for yourself, returns C<undef>.
@ -7756,7 +7756,7 @@ through the end of the file).
Because C<use> takes effect at compile time, it doesn't respect the Because C<use> takes effect at compile time, it doesn't respect the
ordinary flow control of the code being compiled. In particular, putting ordinary flow control of the code being compiled. In particular, putting
a C<use> inside the false branch of a conditional doesn't prevent it a C<use> inside the false branch of a conditional doesn't prevent it
from being processed. If a module or pragma only needs to be loaded from being processed. If a module or pragma only needs to be loaded
conditionally, this can be done using the L<if> pragma: conditionally, this can be done using the L<if> pragma:
use if $] < 5.008, "utf8"; use if $] < 5.008, "utf8";
@ -7764,7 +7764,7 @@ conditionally, this can be done using the L<if> pragma:
There's a corresponding C<no> declaration that unimports meanings imported There's a corresponding C<no> declaration that unimports meanings imported
by C<use>, i.e., it calls C<unimport Module LIST> instead of C<import>. by C<use>, i.e., it calls C<unimport Module LIST> instead of C<import>.
It behaves just as C<import> does with VERSION, an omitted or empty LIST, It behaves just as C<import> does with VERSION, an omitted or empty LIST,
or no unimport method being found. or no unimport method being found.
no integer; no integer;
@ -7795,7 +7795,7 @@ the user running the program:
$atime = $mtime = time; $atime = $mtime = time;
utime $atime, $mtime, @ARGV; utime $atime, $mtime, @ARGV;
Since Perl 5.7.2, if the first two elements of the list are C<undef>, Since Perl 5.7.2, if the first two elements of the list are C<undef>,
the utime(2) syscall from your C library is called with a null second the utime(2) syscall from your C library is called with a null second
argument. On most systems, this will set the file's access and argument. On most systems, this will set the file's access and
modification times to the current time (i.e., equivalent to the example modification times to the current time (i.e., equivalent to the example
@ -7803,9 +7803,9 @@ above) and will work even on files you don't own provided you have write
permission: permission:
for $file (@ARGV) { for $file (@ARGV) {
utime(undef, undef, $file) utime(undef, undef, $file)
|| warn "couldn't touch $file: $!"; || warn "couldn't touch $file: $!";
} }
Under NFS this will use the time of the NFS server, not the time of Under NFS this will use the time of the NFS server, not the time of
the local machine. If there is a time synchronization problem, the the local machine. If there is a time synchronization problem, the
@ -7814,7 +7814,7 @@ touch(1) command will in fact normally use this form instead of the
one shown in the first example. one shown in the first example.
Passing only one of the first two elements as C<undef> is Passing only one of the first two elements as C<undef> is
equivalent to passing a 0 and will not have the effect equivalent to passing a 0 and will not have the effect
described when both are C<undef>. This also triggers an described when both are C<undef>. This also triggers an
uninitialized warning. uninitialized warning.
@ -7904,7 +7904,7 @@ to try to write off the beginning of the string (i.e., negative OFFSET).
If the string happens to be encoded as UTF-8 internally (and thus has If the string happens to be encoded as UTF-8 internally (and thus has
the UTF8 flag set), this is ignored by C<vec>, and it operates on the the UTF8 flag set), this is ignored by C<vec>, and it operates on the
internal byte string, not the conceptual character string, even if you internal byte string, not the conceptual character string, even if you
only have characters with values less than 256. only have characters with values less than 256.
Strings created with C<vec> can also be manipulated with the logical Strings created with C<vec> can also be manipulated with the logical
operators C<|>, C<&>, C<^>, and C<~>. These operators will assume a bit operators C<|>, C<&>, C<^>, and C<~>. These operators will assume a bit
@ -7970,7 +7970,7 @@ Here is an example to illustrate how the bits actually fall in place:
. .
__END__ __END__
Regardless of the machine architecture on which it runs, the Regardless of the machine architecture on which it runs, the
example above should print the following table: example above should print the following table:
0 1 2 3 0 1 2 3
@ -8218,7 +8218,7 @@ X<when>
C<when> is analogous to the C<case> keyword in other languages. Used with a C<when> is analogous to the C<case> keyword in other languages. Used with a
C<foreach> loop or the experimental C<given> block, C<when> can be used in C<foreach> loop or the experimental C<given> block, C<when> can be used in
Perl to implement C<switch>/C<case> like statements. Available as a Perl to implement C<switch>/C<case> like statements. Available as a
statement after Perl 5.10 and as a statement modifier after 5.14. statement after Perl 5.10 and as a statement modifier after 5.14.
Here are three examples: Here are three examples:
use v5.10; use v5.10;
@ -8237,7 +8237,7 @@ Here are three examples:
# require 5.14 for when as statement modifier # require 5.14 for when as statement modifier
use v5.14; use v5.14;
foreach (@fruits) { foreach (@fruits) {
say "I like apples." when /apples?/; say "I like apples." when /apples?/;
say "I don't like oranges." when /oranges?; say "I don't like oranges." when /oranges?;
default { say "I don't like anything" } default { say "I don't like anything" }
} }

View file

@ -169,7 +169,7 @@ or
perl /path/to/lib/Pod/Functions.pm perl /path/to/lib/Pod/Functions.pm
This will print a grouped list of Perl's functions, like the This will print a grouped list of Perl's functions, like the
L<perlfunc/"Perl Functions by Category"> section. L<perlfunc/"Perl Functions by Category"> section.
=head1 DESCRIPTION =head1 DESCRIPTION
@ -190,12 +190,12 @@ The category can be a comma separated list.
=item %Flavor =item %Flavor
In this hash each key represents a function and the value is a short In this hash each key represents a function and the value is a short
description of that function. description of that function.
=item %Type_Description =item %Type_Description
In this hash each key represents a category of functions and the value is In this hash each key represents a category of functions and the value is
a short description of that category. a short description of that category.
=item @Type_Order =item @Type_Order
@ -246,20 +246,20 @@ while (<DATA>) {
close DATA; close DATA;
my( $typedesc, $list ); my( $typedesc, $list );
unless (caller) { unless (caller) {
foreach my $type ( @Type_Order ) { foreach my $type ( @Type_Order ) {
$list = join(", ", sort @{$Kinds{$type}}); $list = join(", ", sort @{$Kinds{$type}});
$typedesc = $Type_Description{$type} . ":"; $typedesc = $Type_Description{$type} . ":";
write; write;
} }
} }
format = format =
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$typedesc $typedesc
~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$typedesc $typedesc
~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$list $list
. .

View file

@ -7693,15 +7693,15 @@ are automatically rebound to the current values of such variables.
with alpha parts. with alpha parts.
=item Verb pattern '%s' has a mandatory argument in regex; marked by =item Verb pattern '%s' has a mandatory argument in regex; marked by
S<<-- HERE> in m/%s/ S<<-- HERE> in m/%s/
(F) You used a verb pattern that requires an argument. Supply an (F) You used a verb pattern that requires an argument. Supply an
argument or check that you are using the right verb. argument or check that you are using the right verb.
=item Verb pattern '%s' may not have an argument in regex; marked by =item Verb pattern '%s' may not have an argument in regex; marked by
S<<-- HERE> in m/%s/ S<<-- HERE> in m/%s/
(F) You used a verb pattern that is not allowed an argument. Remove the (F) You used a verb pattern that is not allowed an argument. Remove the
argument or check that you are using the right verb. argument or check that you are using the right verb.
=item Version control conflict marker =item Version control conflict marker

View file

@ -31,8 +31,8 @@ Output record formats are declared as follows:
FORMLIST FORMLIST
. .
If the name is omitted, format "STDOUT" is defined. A single "." in If the name is omitted, format "STDOUT" is defined. A single "." in
column 1 is used to terminate a format. FORMLIST consists of a sequence column 1 is used to terminate a format. FORMLIST consists of a sequence
of lines, each of which may be one of three types: of lines, each of which may be one of three types:
=over 4 =over 4
@ -84,13 +84,13 @@ the various possibilities in detail.
=head2 Text Fields =head2 Text Fields
X<format, text field> X<format, text field>
The length of the field is supplied by padding out the field with multiple The length of the field is supplied by padding out the field with multiple
"E<lt>", "E<gt>", or "|" characters to specify a non-numeric field with, "E<lt>", "E<gt>", or "|" characters to specify a non-numeric field with,
respectively, left justification, right justification, or centering. respectively, left justification, right justification, or centering.
For a regular field, the value (up to the first newline) is taken and For a regular field, the value (up to the first newline) is taken and
printed according to the selected justification, truncating excess characters. printed according to the selected justification, truncating excess characters.
If you terminate a text field with "...", three dots will be shown if If you terminate a text field with "...", three dots will be shown if
the value is truncated. A special text field may be used to do rudimentary the value is truncated. A special text field may be used to do rudimentary
multi-line text block filling; see L</Using Fill Mode> for details. multi-line text block filling; see L</Using Fill Mode> for details.
Example: Example:
@ -133,10 +133,10 @@ line feed is chomped off, but all other characters are emitted verbatim.
=head2 The Field ^* for Variable-Width One-line-at-a-time Text =head2 The Field ^* for Variable-Width One-line-at-a-time Text
X<^*> X<^*>
Like "@*", this is a variable-width field. The value supplied must be a Like "@*", this is a variable-width field. The value supplied must be a
scalar variable. Perl puts the first line (up to the first "\n") of the scalar variable. Perl puts the first line (up to the first "\n") of the
text into the field, and then chops off the front of the string so that text into the field, and then chops off the front of the string so that
the next time the variable is referenced, more of the text can be printed. the next time the variable is referenced, more of the text can be printed.
The variable will I<not> be restored. The variable will I<not> be restored.
Example: Example:
@ -183,15 +183,15 @@ the variable is referenced, more of the text can be printed. (Yes, this
means that the variable itself is altered during execution of the write() means that the variable itself is altered during execution of the write()
call, and is not restored.) The next portion of text is determined by call, and is not restored.) The next portion of text is determined by
a crude line-breaking algorithm. You may use the carriage return character a crude line-breaking algorithm. You may use the carriage return character
(C<\r>) to force a line break. You can change which characters are legal (C<\r>) to force a line break. You can change which characters are legal
to break on by changing the variable C<$:> (that's to break on by changing the variable C<$:> (that's
$FORMAT_LINE_BREAK_CHARACTERS if you're using the English module) to a $FORMAT_LINE_BREAK_CHARACTERS if you're using the English module) to a
list of the desired characters. list of the desired characters.
Normally you would use a sequence of fields in a vertical stack associated Normally you would use a sequence of fields in a vertical stack associated
with the same scalar variable to print out a block of text. You might wish with the same scalar variable to print out a block of text. You might wish
to end the final field with the text "...", which will appear in the output to end the final field with the text "...", which will appear in the output
if the text was too long to appear in its entirety. if the text was too long to appear in its entirety.
=head2 Suppressing Lines Where All Fields Are Void =head2 Suppressing Lines Where All Fields Are Void
@ -210,7 +210,7 @@ the line will be repeated until all the fields on the line are exhausted,
i.e. undefined. For special (caret) text fields this will occur sooner or i.e. undefined. For special (caret) text fields this will occur sooner or
later, but if you use a text field of the at variety, the expression you later, but if you use a text field of the at variety, the expression you
supply had better not give the same value every time forever! (C<shift(@f)> supply had better not give the same value every time forever! (C<shift(@f)>
is a simple example that would work.) Don't use a regular (at) numeric is a simple example that would work.) Don't use a regular (at) numeric
field in such lines, because it will never go blank. field in such lines, because it will never go blank.

View file

@ -1,5 +1,5 @@
#!/usr/bin/perl #!/usr/bin/perl
# #
# Regenerate (overwriting only if changed): # Regenerate (overwriting only if changed):
# #
# lib/feature.pm # lib/feature.pm

View file

@ -30,9 +30,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.\" $OpenBSD: malloc.3,v 1.136 2023/06/30 06:24:58 otto Exp $ .\" $OpenBSD: malloc.3,v 1.137 2023/07/01 18:35:14 otto Exp $
.\" .\"
.Dd $Mdocdate: June 30 2023 $ .Dd $Mdocdate: July 1 2023 $
.Dt MALLOC 3 .Dt MALLOC 3
.Os .Os
.Sh NAME .Sh NAME
@ -325,7 +325,7 @@ Increase the junk level by one if it is smaller than 2.
Decrease the junk level by one if it is larger than 0. Decrease the junk level by one if it is larger than 0.
Junking writes some junk bytes into the area allocated. Junking writes some junk bytes into the area allocated.
Junk is bytes of 0xdb when allocating; Junk is bytes of 0xdb when allocating;
freed allocations are filled with 0xdf. small allocations are initially junked with 0xdf as are freed allocations.
By default the junk level is 1: after free, By default the junk level is 1: after free,
small chunks are completely junked; small chunks are completely junked;
for pages the first part is junked. for pages the first part is junked.

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: uuid_compare.3,v 1.2 2020/11/14 10:35:58 jmc Exp $ .\" $OpenBSD: uuid_compare.3,v 1.3 2023/07/03 08:53:27 jasper Exp $
.\" $NetBSD: uuid.3,v 1.7 2008/05/02 18:11:05 martin Exp $ .\" $NetBSD: uuid.3,v 1.7 2008/05/02 18:11:05 martin Exp $
.\" .\"
.\" Copyright (c) 2004 The NetBSD Foundation, Inc. .\" Copyright (c) 2004 The NetBSD Foundation, Inc.
@ -55,7 +55,7 @@
.\" .\"
.\" $FreeBSD: src/lib/libc/uuid/uuid.3,v 1.4 2003/08/08 19:12:28 marcel Exp $ .\" $FreeBSD: src/lib/libc/uuid/uuid.3,v 1.4 2003/08/08 19:12:28 marcel Exp $
.\" .\"
.Dd $Mdocdate: November 14 2020 $ .Dd $Mdocdate: July 3 2023 $
.Dt UUID_COMPARE 3 .Dt UUID_COMPARE 3
.Os .Os
.Sh NAME .Sh NAME
@ -84,11 +84,11 @@
.Ft void .Ft void
.Fn uuid_enc_le "void *buf" "const uuid_t *uuid" .Fn uuid_enc_le "void *buf" "const uuid_t *uuid"
.Ft void .Ft void
.Fn uuid_dec_le "const void *buf" "uuid_t *" .Fn uuid_dec_le "const void *buf" "uuid_t *uuid"
.Ft void .Ft void
.Fn uuid_enc_be "void *buf" "const uuid_t *uuid" .Fn uuid_enc_be "void *buf" "const uuid_t *uuid"
.Ft void .Ft void
.Fn uuid_dec_be "const void *buf" "uuid_t *" .Fn uuid_dec_be "const void *buf" "uuid_t *uuid"
.Sh DESCRIPTION .Sh DESCRIPTION
These routines provide for the creation and manipulation of Universally These routines provide for the creation and manipulation of Universally
Unique Identifiers Unique Identifiers

View file

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.133 2023/06/29 06:12:04 tb Exp $ # $OpenBSD: Makefile,v 1.136 2023/07/06 14:37:39 tb Exp $
LIB= crypto LIB= crypto
LIBREBUILD=y LIBREBUILD=y
@ -195,6 +195,7 @@ SRCS+= bn_mont.c
SRCS+= bn_mul.c SRCS+= bn_mul.c
SRCS+= bn_prime.c SRCS+= bn_prime.c
SRCS+= bn_primitives.c SRCS+= bn_primitives.c
SRCS+= bn_print.c
SRCS+= bn_rand.c SRCS+= bn_rand.c
SRCS+= bn_recp.c SRCS+= bn_recp.c
SRCS+= bn_shift.c SRCS+= bn_shift.c
@ -351,16 +352,14 @@ SRCS+= ecp_smpl.c
SRCS+= ecx_methods.c SRCS+= ecx_methods.c
# ecdh/ # ecdh/
SRCS+= ecdh_kdf.c SRCS+= ecdh.c
SRCS+= ech_err.c SRCS+= ech_err.c
SRCS+= ech_key.c
SRCS+= ech_lib.c SRCS+= ech_lib.c
# ecdsa/ # ecdsa/
SRCS+= ecs_asn1.c
SRCS+= ecs_err.c SRCS+= ecs_err.c
SRCS+= ecs_lib.c SRCS+= ecs_lib.c
SRCS+= ecs_ossl.c SRCS+= ecdsa.c
# engine/ # engine/
SRCS+= eng_all.c SRCS+= eng_all.c

View file

@ -889,3 +889,377 @@ _libre_X509v3_addr_validate_path
_libre_X509v3_asid_validate_resource_set _libre_X509v3_asid_validate_resource_set
_libre_X509v3_addr_validate_resource_set _libre_X509v3_addr_validate_resource_set
_libre_ERR_load_X509V3_strings _libre_ERR_load_X509V3_strings
_libre_ChaCha_set_key
_libre_ChaCha_set_iv
_libre_ChaCha
_libre_CRYPTO_chacha_20
_libre_CRYPTO_xchacha_20
_libre_CRYPTO_hchacha_20
_libre_d2i_ASN1_SEQUENCE_ANY
_libre_i2d_ASN1_SEQUENCE_ANY
_libre_d2i_ASN1_SET_ANY
_libre_i2d_ASN1_SET_ANY
_libre_ASN1_TYPE_new
_libre_ASN1_TYPE_free
_libre_d2i_ASN1_TYPE
_libre_i2d_ASN1_TYPE
_libre_ASN1_TYPE_get
_libre_ASN1_TYPE_set
_libre_ASN1_TYPE_set1
_libre_ASN1_TYPE_cmp
_libre_ASN1_OBJECT_new
_libre_ASN1_OBJECT_free
_libre_i2d_ASN1_OBJECT
_libre_d2i_ASN1_OBJECT
_libre_ASN1_STRING_new
_libre_ASN1_STRING_free
_libre_ASN1_STRING_copy
_libre_ASN1_STRING_dup
_libre_ASN1_STRING_type_new
_libre_ASN1_STRING_cmp
_libre_ASN1_STRING_set
_libre_ASN1_STRING_set0
_libre_ASN1_STRING_length
_libre_ASN1_STRING_length_set
_libre_ASN1_STRING_type
_libre_ASN1_STRING_data
_libre_ASN1_STRING_get0_data
_libre_ASN1_BIT_STRING_new
_libre_ASN1_BIT_STRING_free
_libre_d2i_ASN1_BIT_STRING
_libre_i2d_ASN1_BIT_STRING
_libre_ASN1_BIT_STRING_set
_libre_ASN1_BIT_STRING_set_bit
_libre_ASN1_BIT_STRING_get_bit
_libre_ASN1_BIT_STRING_check
_libre_ASN1_BIT_STRING_name_print
_libre_ASN1_BIT_STRING_num_asc
_libre_ASN1_BIT_STRING_set_asc
_libre_ASN1_INTEGER_new
_libre_ASN1_INTEGER_free
_libre_d2i_ASN1_INTEGER
_libre_i2d_ASN1_INTEGER
_libre_d2i_ASN1_UINTEGER
_libre_ASN1_INTEGER_dup
_libre_ASN1_INTEGER_cmp
_libre_ASN1_ENUMERATED_new
_libre_ASN1_ENUMERATED_free
_libre_d2i_ASN1_ENUMERATED
_libre_i2d_ASN1_ENUMERATED
_libre_ASN1_UTCTIME_check
_libre_ASN1_UTCTIME_set
_libre_ASN1_UTCTIME_adj
_libre_ASN1_UTCTIME_set_string
_libre_ASN1_UTCTIME_cmp_time_t
_libre_ASN1_GENERALIZEDTIME_check
_libre_ASN1_GENERALIZEDTIME_set
_libre_ASN1_GENERALIZEDTIME_adj
_libre_ASN1_GENERALIZEDTIME_set_string
_libre_ASN1_OCTET_STRING_new
_libre_ASN1_OCTET_STRING_free
_libre_d2i_ASN1_OCTET_STRING
_libre_i2d_ASN1_OCTET_STRING
_libre_ASN1_OCTET_STRING_dup
_libre_ASN1_OCTET_STRING_cmp
_libre_ASN1_OCTET_STRING_set
_libre_ASN1_VISIBLESTRING_new
_libre_ASN1_VISIBLESTRING_free
_libre_d2i_ASN1_VISIBLESTRING
_libre_i2d_ASN1_VISIBLESTRING
_libre_ASN1_UNIVERSALSTRING_new
_libre_ASN1_UNIVERSALSTRING_free
_libre_d2i_ASN1_UNIVERSALSTRING
_libre_i2d_ASN1_UNIVERSALSTRING
_libre_ASN1_UTF8STRING_new
_libre_ASN1_UTF8STRING_free
_libre_d2i_ASN1_UTF8STRING
_libre_i2d_ASN1_UTF8STRING
_libre_ASN1_NULL_new
_libre_ASN1_NULL_free
_libre_d2i_ASN1_NULL
_libre_i2d_ASN1_NULL
_libre_ASN1_BMPSTRING_new
_libre_ASN1_BMPSTRING_free
_libre_d2i_ASN1_BMPSTRING
_libre_i2d_ASN1_BMPSTRING
_libre_ASN1_PRINTABLE_new
_libre_ASN1_PRINTABLE_free
_libre_d2i_ASN1_PRINTABLE
_libre_i2d_ASN1_PRINTABLE
_libre_DIRECTORYSTRING_new
_libre_DIRECTORYSTRING_free
_libre_d2i_DIRECTORYSTRING
_libre_i2d_DIRECTORYSTRING
_libre_DISPLAYTEXT_new
_libre_DISPLAYTEXT_free
_libre_d2i_DISPLAYTEXT
_libre_i2d_DISPLAYTEXT
_libre_ASN1_PRINTABLESTRING_new
_libre_ASN1_PRINTABLESTRING_free
_libre_d2i_ASN1_PRINTABLESTRING
_libre_i2d_ASN1_PRINTABLESTRING
_libre_ASN1_T61STRING_new
_libre_ASN1_T61STRING_free
_libre_d2i_ASN1_T61STRING
_libre_i2d_ASN1_T61STRING
_libre_ASN1_IA5STRING_new
_libre_ASN1_IA5STRING_free
_libre_d2i_ASN1_IA5STRING
_libre_i2d_ASN1_IA5STRING
_libre_ASN1_GENERALSTRING_new
_libre_ASN1_GENERALSTRING_free
_libre_d2i_ASN1_GENERALSTRING
_libre_i2d_ASN1_GENERALSTRING
_libre_ASN1_UTCTIME_new
_libre_ASN1_UTCTIME_free
_libre_d2i_ASN1_UTCTIME
_libre_i2d_ASN1_UTCTIME
_libre_ASN1_GENERALIZEDTIME_new
_libre_ASN1_GENERALIZEDTIME_free
_libre_d2i_ASN1_GENERALIZEDTIME
_libre_i2d_ASN1_GENERALIZEDTIME
_libre_ASN1_TIME_new
_libre_ASN1_TIME_free
_libre_d2i_ASN1_TIME
_libre_i2d_ASN1_TIME
_libre_ASN1_TIME_to_tm
_libre_ASN1_TIME_compare
_libre_ASN1_TIME_cmp_time_t
_libre_ASN1_TIME_normalize
_libre_ASN1_TIME_set_string_X509
_libre_ASN1_TIME_diff
_libre_ASN1_TIME_set
_libre_ASN1_TIME_set_tm
_libre_ASN1_TIME_adj
_libre_ASN1_TIME_check
_libre_ASN1_TIME_to_generalizedtime
_libre_ASN1_TIME_set_string
_libre_i2a_ASN1_INTEGER
_libre_a2i_ASN1_INTEGER
_libre_i2a_ASN1_ENUMERATED
_libre_a2i_ASN1_ENUMERATED
_libre_i2a_ASN1_OBJECT
_libre_a2i_ASN1_STRING
_libre_i2a_ASN1_STRING
_libre_i2t_ASN1_OBJECT
_libre_a2d_ASN1_OBJECT
_libre_ASN1_OBJECT_create
_libre_ASN1_INTEGER_get_uint64
_libre_ASN1_INTEGER_set_uint64
_libre_ASN1_INTEGER_get_int64
_libre_ASN1_INTEGER_set_int64
_libre_ASN1_INTEGER_set
_libre_ASN1_INTEGER_get
_libre_BN_to_ASN1_INTEGER
_libre_ASN1_INTEGER_to_BN
_libre_ASN1_ENUMERATED_get_int64
_libre_ASN1_ENUMERATED_set_int64
_libre_ASN1_ENUMERATED_set
_libre_ASN1_ENUMERATED_get
_libre_BN_to_ASN1_ENUMERATED
_libre_ASN1_ENUMERATED_to_BN
_libre_ASN1_PRINTABLE_type
_libre_ASN1_get_object
_libre_ASN1_put_object
_libre_ASN1_put_eoc
_libre_ASN1_object_size
_libre_ASN1_item_dup
_libre_ASN1_dup
_libre_ASN1_d2i_fp
_libre_ASN1_item_d2i_fp
_libre_ASN1_i2d_fp
_libre_ASN1_item_i2d_fp
_libre_ASN1_STRING_print_ex_fp
_libre_ASN1_STRING_to_UTF8
_libre_ASN1_d2i_bio
_libre_ASN1_item_d2i_bio
_libre_ASN1_i2d_bio
_libre_ASN1_item_i2d_bio
_libre_ASN1_UTCTIME_print
_libre_ASN1_GENERALIZEDTIME_print
_libre_ASN1_TIME_print
_libre_ASN1_STRING_print
_libre_ASN1_STRING_print_ex
_libre_ASN1_bn_print
_libre_ASN1_buf_print
_libre_ASN1_parse
_libre_ASN1_parse_dump
_libre_ASN1_tag2bit
_libre_ASN1_tag2str
_libre_ASN1_UNIVERSALSTRING_to_string
_libre_ASN1_TYPE_set_octetstring
_libre_ASN1_TYPE_get_octetstring
_libre_ASN1_TYPE_set_int_octetstring
_libre_ASN1_TYPE_get_int_octetstring
_libre_ASN1_item_pack
_libre_ASN1_item_unpack
_libre_ASN1_STRING_set_default_mask
_libre_ASN1_STRING_set_default_mask_asc
_libre_ASN1_STRING_get_default_mask
_libre_ASN1_mbstring_copy
_libre_ASN1_mbstring_ncopy
_libre_ASN1_STRING_set_by_NID
_libre_ASN1_STRING_TABLE_get
_libre_ASN1_STRING_TABLE_add
_libre_ASN1_STRING_TABLE_cleanup
_libre_ASN1_item_new
_libre_ASN1_item_free
_libre_ASN1_item_d2i
_libre_ASN1_item_i2d
_libre_ASN1_add_oid_module
_libre_ASN1_generate_nconf
_libre_ASN1_generate_v3
_libre_ASN1_item_print
_libre_ASN1_PCTX_new
_libre_ASN1_PCTX_free
_libre_ASN1_PCTX_get_flags
_libre_ASN1_PCTX_set_flags
_libre_ASN1_PCTX_get_nm_flags
_libre_ASN1_PCTX_set_nm_flags
_libre_ASN1_PCTX_get_cert_flags
_libre_ASN1_PCTX_set_cert_flags
_libre_ASN1_PCTX_get_oid_flags
_libre_ASN1_PCTX_set_oid_flags
_libre_ASN1_PCTX_get_str_flags
_libre_ASN1_PCTX_set_str_flags
_libre_BIO_f_asn1
_libre_SMIME_crlf_copy
_libre_SMIME_text
_libre_ERR_load_ASN1_strings
_libre_ASN1_time_parse
_libre_ASN1_time_tm_cmp
_libre_ASN1_item_ex_new
_libre_ASN1_item_ex_free
_libre_ASN1_template_new
_libre_ASN1_primitive_new
_libre_ASN1_template_free
_libre_ASN1_template_d2i
_libre_ASN1_item_ex_d2i
_libre_ASN1_item_ex_i2d
_libre_ASN1_template_i2d
_libre_ASN1_primitive_free
_libre_BIO_set_flags
_libre_BIO_test_flags
_libre_BIO_clear_flags
_libre_BIO_get_callback
_libre_BIO_set_callback
_libre_BIO_get_callback_ex
_libre_BIO_set_callback_ex
_libre_BIO_get_callback_arg
_libre_BIO_set_callback_arg
_libre_BIO_method_name
_libre_BIO_method_type
_libre_BIO_meth_new
_libre_BIO_meth_free
_libre_BIO_meth_get_write
_libre_BIO_meth_set_write
_libre_BIO_meth_get_read
_libre_BIO_meth_set_read
_libre_BIO_meth_get_puts
_libre_BIO_meth_set_puts
_libre_BIO_meth_get_gets
_libre_BIO_meth_set_gets
_libre_BIO_meth_get_ctrl
_libre_BIO_meth_set_ctrl
_libre_BIO_meth_get_create
_libre_BIO_meth_set_create
_libre_BIO_meth_get_destroy
_libre_BIO_meth_set_destroy
_libre_BIO_meth_get_callback_ctrl
_libre_BIO_meth_set_callback_ctrl
_libre_BIO_ctrl_pending
_libre_BIO_ctrl_wpending
_libre_BIO_ctrl_get_write_guarantee
_libre_BIO_ctrl_get_read_request
_libre_BIO_ctrl_reset_read_request
_libre_BIO_set_ex_data
_libre_BIO_get_ex_data
_libre_BIO_number_read
_libre_BIO_number_written
_libre_BIO_asn1_set_prefix
_libre_BIO_asn1_get_prefix
_libre_BIO_asn1_set_suffix
_libre_BIO_asn1_get_suffix
_libre_BIO_get_new_index
_libre_BIO_s_file
_libre_BIO_new_file
_libre_BIO_new_fp
_libre_BIO_new
_libre_BIO_set
_libre_BIO_free
_libre_BIO_up_ref
_libre_BIO_get_data
_libre_BIO_set_data
_libre_BIO_get_init
_libre_BIO_set_init
_libre_BIO_get_shutdown
_libre_BIO_set_shutdown
_libre_BIO_vfree
_libre_BIO_read
_libre_BIO_gets
_libre_BIO_write
_libre_BIO_puts
_libre_BIO_indent
_libre_BIO_ctrl
_libre_BIO_callback_ctrl
_libre_BIO_ptr_ctrl
_libre_BIO_int_ctrl
_libre_BIO_push
_libre_BIO_pop
_libre_BIO_free_all
_libre_BIO_find_type
_libre_BIO_next
_libre_BIO_set_next
_libre_BIO_get_retry_BIO
_libre_BIO_get_retry_reason
_libre_BIO_set_retry_reason
_libre_BIO_dup_chain
_libre_BIO_nread0
_libre_BIO_nread
_libre_BIO_nwrite0
_libre_BIO_nwrite
_libre_BIO_debug_callback
_libre_BIO_s_mem
_libre_BIO_new_mem_buf
_libre_BIO_s_socket
_libre_BIO_s_connect
_libre_BIO_s_accept
_libre_BIO_s_fd
_libre_BIO_s_log
_libre_BIO_s_bio
_libre_BIO_s_null
_libre_BIO_f_null
_libre_BIO_f_buffer
_libre_BIO_f_nbio_test
_libre_BIO_s_datagram
_libre_BIO_sock_should_retry
_libre_BIO_sock_non_fatal_error
_libre_BIO_dgram_non_fatal_error
_libre_BIO_fd_should_retry
_libre_BIO_fd_non_fatal_error
_libre_BIO_dump
_libre_BIO_dump_indent
_libre_BIO_dump_fp
_libre_BIO_dump_indent_fp
_libre_BIO_gethostbyname
_libre_BIO_sock_error
_libre_BIO_socket_ioctl
_libre_BIO_socket_nbio
_libre_BIO_get_port
_libre_BIO_get_host_ip
_libre_BIO_get_accept_socket
_libre_BIO_accept
_libre_BIO_sock_init
_libre_BIO_sock_cleanup
_libre_BIO_set_tcp_ndelay
_libre_BIO_new_socket
_libre_BIO_new_dgram
_libre_BIO_new_fd
_libre_BIO_new_connect
_libre_BIO_new_accept
_libre_BIO_copy_next_retry
_libre_BIO_printf
_libre_BIO_vprintf
_libre_BIO_snprintf
_libre_BIO_vsnprintf
_libre_ERR_load_BIO_strings

View file

@ -1,4 +1,4 @@
/* $OpenBSD: a_bitstr.c,v 1.38 2023/01/13 14:46:08 tb Exp $ */ /* $OpenBSD: a_bitstr.c,v 1.39 2023/07/05 21:23:36 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -79,12 +79,14 @@ ASN1_BIT_STRING_new(void)
{ {
return (ASN1_BIT_STRING *)ASN1_item_new(&ASN1_BIT_STRING_it); return (ASN1_BIT_STRING *)ASN1_item_new(&ASN1_BIT_STRING_it);
} }
LCRYPTO_ALIAS(ASN1_BIT_STRING_new);
void void
ASN1_BIT_STRING_free(ASN1_BIT_STRING *a) ASN1_BIT_STRING_free(ASN1_BIT_STRING *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &ASN1_BIT_STRING_it); ASN1_item_free((ASN1_VALUE *)a, &ASN1_BIT_STRING_it);
} }
LCRYPTO_ALIAS(ASN1_BIT_STRING_free);
static void static void
asn1_abs_clear_unused_bits(ASN1_BIT_STRING *abs) asn1_abs_clear_unused_bits(ASN1_BIT_STRING *abs)
@ -110,6 +112,7 @@ ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len)
{ {
return ASN1_STRING_set(x, d, len); return ASN1_STRING_set(x, d, len);
} }
LCRYPTO_ALIAS(ASN1_BIT_STRING_set);
int int
ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value) ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
@ -144,6 +147,7 @@ ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
return (1); return (1);
} }
LCRYPTO_ALIAS(ASN1_BIT_STRING_set_bit);
int int
ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n) ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n)
@ -156,6 +160,7 @@ ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n)
return (0); return (0);
return ((a->data[w] & v) != 0); return ((a->data[w] & v) != 0);
} }
LCRYPTO_ALIAS(ASN1_BIT_STRING_get_bit);
/* /*
* Checks if the given bit string contains only bits specified by * Checks if the given bit string contains only bits specified by
@ -182,6 +187,7 @@ ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a, const unsigned char *flags,
} }
return ok; return ok;
} }
LCRYPTO_ALIAS(ASN1_BIT_STRING_check);
int int
ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
@ -202,6 +208,7 @@ ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
BIO_puts(out, "\n"); BIO_puts(out, "\n");
return 1; return 1;
} }
LCRYPTO_ALIAS(ASN1_BIT_STRING_name_print);
int int
ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value, ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value,
@ -218,6 +225,7 @@ ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value,
} }
return 1; return 1;
} }
LCRYPTO_ALIAS(ASN1_BIT_STRING_set_asc);
int int
ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl) ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl)
@ -231,6 +239,7 @@ ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl)
} }
return -1; return -1;
} }
LCRYPTO_ALIAS(ASN1_BIT_STRING_num_asc);
int int
i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp) i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
@ -388,6 +397,7 @@ i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_BIT_STRING_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_BIT_STRING_it);
} }
LCRYPTO_ALIAS(i2d_ASN1_BIT_STRING);
ASN1_BIT_STRING * ASN1_BIT_STRING *
d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **in, long len) d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **in, long len)
@ -395,3 +405,4 @@ d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **in, long len)
return (ASN1_BIT_STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_BIT_STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ASN1_BIT_STRING_it); &ASN1_BIT_STRING_it);
} }
LCRYPTO_ALIAS(d2i_ASN1_BIT_STRING);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: a_enum.c,v 1.28 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: a_enum.c,v 1.29 2023/07/05 21:23:36 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -84,6 +84,7 @@ ASN1_ENUMERATED_new(void)
{ {
return (ASN1_ENUMERATED *)ASN1_item_new(&ASN1_ENUMERATED_it); return (ASN1_ENUMERATED *)ASN1_item_new(&ASN1_ENUMERATED_it);
} }
LCRYPTO_ALIAS(ASN1_ENUMERATED_new);
static void static void
asn1_aenum_clear(ASN1_ENUMERATED *aenum) asn1_aenum_clear(ASN1_ENUMERATED *aenum)
@ -100,6 +101,7 @@ ASN1_ENUMERATED_free(ASN1_ENUMERATED *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &ASN1_ENUMERATED_it); ASN1_item_free((ASN1_VALUE *)a, &ASN1_ENUMERATED_it);
} }
LCRYPTO_ALIAS(ASN1_ENUMERATED_free);
int int
ASN1_ENUMERATED_get_int64(int64_t *out_val, const ASN1_ENUMERATED *aenum) ASN1_ENUMERATED_get_int64(int64_t *out_val, const ASN1_ENUMERATED *aenum)
@ -122,6 +124,7 @@ ASN1_ENUMERATED_get_int64(int64_t *out_val, const ASN1_ENUMERATED *aenum)
return asn1_aint_get_int64(&cbs, (aenum->type == V_ASN1_NEG_ENUMERATED), return asn1_aint_get_int64(&cbs, (aenum->type == V_ASN1_NEG_ENUMERATED),
out_val); out_val);
} }
LCRYPTO_ALIAS(ASN1_ENUMERATED_get_int64);
int int
ASN1_ENUMERATED_set_int64(ASN1_ENUMERATED *aenum, int64_t val) ASN1_ENUMERATED_set_int64(ASN1_ENUMERATED *aenum, int64_t val)
@ -139,6 +142,7 @@ ASN1_ENUMERATED_set_int64(ASN1_ENUMERATED *aenum, int64_t val)
return asn1_aint_set_uint64(uval, &aenum->data, &aenum->length); return asn1_aint_set_uint64(uval, &aenum->data, &aenum->length);
} }
LCRYPTO_ALIAS(ASN1_ENUMERATED_set_int64);
long long
ASN1_ENUMERATED_get(const ASN1_ENUMERATED *aenum) ASN1_ENUMERATED_get(const ASN1_ENUMERATED *aenum)
@ -156,12 +160,14 @@ ASN1_ENUMERATED_get(const ASN1_ENUMERATED *aenum)
return (long)val; return (long)val;
} }
LCRYPTO_ALIAS(ASN1_ENUMERATED_get);
int int
ASN1_ENUMERATED_set(ASN1_ENUMERATED *aenum, long val) ASN1_ENUMERATED_set(ASN1_ENUMERATED *aenum, long val)
{ {
return ASN1_ENUMERATED_set_int64(aenum, val); return ASN1_ENUMERATED_set_int64(aenum, val);
} }
LCRYPTO_ALIAS(ASN1_ENUMERATED_set);
ASN1_ENUMERATED * ASN1_ENUMERATED *
BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai) BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai)
@ -205,6 +211,7 @@ BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai)
ASN1_ENUMERATED_free(ret); ASN1_ENUMERATED_free(ret);
return (NULL); return (NULL);
} }
LCRYPTO_ALIAS(BN_to_ASN1_ENUMERATED);
BIGNUM * BIGNUM *
ASN1_ENUMERATED_to_BN(const ASN1_ENUMERATED *ai, BIGNUM *bn) ASN1_ENUMERATED_to_BN(const ASN1_ENUMERATED *ai, BIGNUM *bn)
@ -217,6 +224,7 @@ ASN1_ENUMERATED_to_BN(const ASN1_ENUMERATED *ai, BIGNUM *bn)
BN_set_negative(ret, 1); BN_set_negative(ret, 1);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(ASN1_ENUMERATED_to_BN);
/* Based on a_int.c: equivalent ENUMERATED functions */ /* Based on a_int.c: equivalent ENUMERATED functions */
@ -253,6 +261,7 @@ i2a_ASN1_ENUMERATED(BIO *bp, const ASN1_ENUMERATED *a)
err: err:
return (-1); return (-1);
} }
LCRYPTO_ALIAS(i2a_ASN1_ENUMERATED);
int int
a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size)
@ -344,6 +353,7 @@ a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size)
free(s); free(s);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(a2i_ASN1_ENUMERATED);
int int
c2i_ASN1_ENUMERATED_cbs(ASN1_ENUMERATED **out_aenum, CBS *cbs) c2i_ASN1_ENUMERATED_cbs(ASN1_ENUMERATED **out_aenum, CBS *cbs)
@ -372,6 +382,7 @@ i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_ENUMERATED_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_ENUMERATED_it);
} }
LCRYPTO_ALIAS(i2d_ASN1_ENUMERATED);
ASN1_ENUMERATED * ASN1_ENUMERATED *
d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, const unsigned char **in, long len) d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, const unsigned char **in, long len)
@ -379,3 +390,4 @@ d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, const unsigned char **in, long len)
return (ASN1_ENUMERATED *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_ENUMERATED *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ASN1_ENUMERATED_it); &ASN1_ENUMERATED_it);
} }
LCRYPTO_ALIAS(d2i_ASN1_ENUMERATED);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: a_int.c,v 1.46 2022/08/28 17:49:25 jsing Exp $ */ /* $OpenBSD: a_int.c,v 1.47 2023/07/05 21:23:36 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -79,6 +79,7 @@ ASN1_INTEGER_new(void)
{ {
return (ASN1_INTEGER *)ASN1_item_new(&ASN1_INTEGER_it); return (ASN1_INTEGER *)ASN1_item_new(&ASN1_INTEGER_it);
} }
LCRYPTO_ALIAS(ASN1_INTEGER_new);
static void static void
asn1_aint_clear(ASN1_INTEGER *aint) asn1_aint_clear(ASN1_INTEGER *aint)
@ -95,6 +96,7 @@ ASN1_INTEGER_free(ASN1_INTEGER *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &ASN1_INTEGER_it); ASN1_item_free((ASN1_VALUE *)a, &ASN1_INTEGER_it);
} }
LCRYPTO_ALIAS(ASN1_INTEGER_free);
static int static int
ASN1_INTEGER_valid(const ASN1_INTEGER *a) ASN1_INTEGER_valid(const ASN1_INTEGER *a)
@ -110,6 +112,7 @@ ASN1_INTEGER_dup(const ASN1_INTEGER *x)
return ASN1_STRING_dup(x); return ASN1_STRING_dup(x);
} }
LCRYPTO_ALIAS(ASN1_INTEGER_dup);
int int
ASN1_INTEGER_cmp(const ASN1_INTEGER *a, const ASN1_INTEGER *b) ASN1_INTEGER_cmp(const ASN1_INTEGER *a, const ASN1_INTEGER *b)
@ -125,6 +128,7 @@ ASN1_INTEGER_cmp(const ASN1_INTEGER *a, const ASN1_INTEGER *b)
return ret; return ret;
} }
LCRYPTO_ALIAS(ASN1_INTEGER_cmp);
int int
asn1_aint_get_uint64(CBS *cbs, uint64_t *out_val) asn1_aint_get_uint64(CBS *cbs, uint64_t *out_val)
@ -248,6 +252,7 @@ ASN1_INTEGER_get_uint64(uint64_t *out_val, const ASN1_INTEGER *aint)
return 1; return 1;
} }
LCRYPTO_ALIAS(ASN1_INTEGER_get_uint64);
int int
ASN1_INTEGER_set_uint64(ASN1_INTEGER *aint, uint64_t val) ASN1_INTEGER_set_uint64(ASN1_INTEGER *aint, uint64_t val)
@ -256,6 +261,7 @@ ASN1_INTEGER_set_uint64(ASN1_INTEGER *aint, uint64_t val)
return asn1_aint_set_uint64(val, &aint->data, &aint->length); return asn1_aint_set_uint64(val, &aint->data, &aint->length);
} }
LCRYPTO_ALIAS(ASN1_INTEGER_set_uint64);
int int
ASN1_INTEGER_get_int64(int64_t *out_val, const ASN1_INTEGER *aint) ASN1_INTEGER_get_int64(int64_t *out_val, const ASN1_INTEGER *aint)
@ -278,6 +284,7 @@ ASN1_INTEGER_get_int64(int64_t *out_val, const ASN1_INTEGER *aint)
return asn1_aint_get_int64(&cbs, (aint->type == V_ASN1_NEG_INTEGER), return asn1_aint_get_int64(&cbs, (aint->type == V_ASN1_NEG_INTEGER),
out_val); out_val);
} }
LCRYPTO_ALIAS(ASN1_INTEGER_get_int64);
int int
ASN1_INTEGER_set_int64(ASN1_INTEGER *aint, int64_t val) ASN1_INTEGER_set_int64(ASN1_INTEGER *aint, int64_t val)
@ -295,6 +302,7 @@ ASN1_INTEGER_set_int64(ASN1_INTEGER *aint, int64_t val)
return asn1_aint_set_uint64(uval, &aint->data, &aint->length); return asn1_aint_set_uint64(uval, &aint->data, &aint->length);
} }
LCRYPTO_ALIAS(ASN1_INTEGER_set_int64);
long long
ASN1_INTEGER_get(const ASN1_INTEGER *aint) ASN1_INTEGER_get(const ASN1_INTEGER *aint)
@ -312,12 +320,14 @@ ASN1_INTEGER_get(const ASN1_INTEGER *aint)
return (long)val; return (long)val;
} }
LCRYPTO_ALIAS(ASN1_INTEGER_get);
int int
ASN1_INTEGER_set(ASN1_INTEGER *aint, long val) ASN1_INTEGER_set(ASN1_INTEGER *aint, long val)
{ {
return ASN1_INTEGER_set_int64(aint, val); return ASN1_INTEGER_set_int64(aint, val);
} }
LCRYPTO_ALIAS(ASN1_INTEGER_set);
ASN1_INTEGER * ASN1_INTEGER *
BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai) BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai)
@ -365,6 +375,7 @@ BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai)
ASN1_INTEGER_free(ret); ASN1_INTEGER_free(ret);
return (NULL); return (NULL);
} }
LCRYPTO_ALIAS(BN_to_ASN1_INTEGER);
BIGNUM * BIGNUM *
ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn) ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn)
@ -380,6 +391,7 @@ ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn)
BN_set_negative(ret, 1); BN_set_negative(ret, 1);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(ASN1_INTEGER_to_BN);
int int
i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a) i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a)
@ -420,6 +432,7 @@ i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a)
err: err:
return (-1); return (-1);
} }
LCRYPTO_ALIAS(i2a_ASN1_INTEGER);
int int
a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size)
@ -509,6 +522,7 @@ a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size)
free(s); free(s);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(a2i_ASN1_INTEGER);
static void static void
asn1_aint_twos_complement(uint8_t *data, size_t data_len) asn1_aint_twos_complement(uint8_t *data, size_t data_len)
@ -757,6 +771,7 @@ i2d_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_INTEGER_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_INTEGER_it);
} }
LCRYPTO_ALIAS(i2d_ASN1_INTEGER);
ASN1_INTEGER * ASN1_INTEGER *
d2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **in, long len) d2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **in, long len)
@ -764,6 +779,7 @@ d2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **in, long len)
return (ASN1_INTEGER *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_INTEGER *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ASN1_INTEGER_it); &ASN1_INTEGER_it);
} }
LCRYPTO_ALIAS(d2i_ASN1_INTEGER);
/* This is a version of d2i_ASN1_INTEGER that ignores the sign bit of /* This is a version of d2i_ASN1_INTEGER that ignores the sign bit of
* ASN1 integers: some broken software can encode a positive INTEGER * ASN1 integers: some broken software can encode a positive INTEGER
@ -838,3 +854,4 @@ d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, long length)
ASN1_INTEGER_free(ret); ASN1_INTEGER_free(ret);
return (NULL); return (NULL);
} }
LCRYPTO_ALIAS(d2i_ASN1_UINTEGER);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: a_mbstr.c,v 1.26 2022/12/26 07:18:51 jmc Exp $ */ /* $OpenBSD: a_mbstr.c,v 1.27 2023/07/05 21:23:36 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999. * project 1999.
*/ */
@ -90,6 +90,7 @@ ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len,
{ {
return ASN1_mbstring_ncopy(out, in, len, inform, mask, 0, 0); return ASN1_mbstring_ncopy(out, in, len, inform, mask, 0, 0);
} }
LCRYPTO_ALIAS(ASN1_mbstring_copy);
int int
ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
@ -255,6 +256,7 @@ ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
} }
return -1; return -1;
} }
LCRYPTO_ALIAS(ASN1_mbstring_ncopy);
/* This function traverses a string and passes the value of each character /* This function traverses a string and passes the value of each character
* to an optional function along with a void * argument. * to an optional function along with a void * argument.

View file

@ -1,4 +1,4 @@
/* $OpenBSD: a_object.c,v 1.50 2023/05/23 11:51:12 tb Exp $ */ /* $OpenBSD: a_object.c,v 1.51 2023/07/05 21:23:36 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -87,6 +87,7 @@ ASN1_OBJECT_new(void)
return a; return a;
} }
LCRYPTO_ALIAS(ASN1_OBJECT_new);
void void
ASN1_OBJECT_free(ASN1_OBJECT *a) ASN1_OBJECT_free(ASN1_OBJECT *a)
@ -106,6 +107,7 @@ ASN1_OBJECT_free(ASN1_OBJECT *a)
if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC) if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC)
free(a); free(a);
} }
LCRYPTO_ALIAS(ASN1_OBJECT_free);
ASN1_OBJECT * ASN1_OBJECT *
ASN1_OBJECT_create(int nid, unsigned char *data, int len, ASN1_OBJECT_create(int nid, unsigned char *data, int len,
@ -122,6 +124,7 @@ ASN1_OBJECT_create(int nid, unsigned char *data, int len,
ASN1_OBJECT_FLAG_DYNAMIC_DATA; ASN1_OBJECT_FLAG_DYNAMIC_DATA;
return (OBJ_dup(&o)); return (OBJ_dup(&o));
} }
LCRYPTO_ALIAS(ASN1_OBJECT_create);
static int static int
oid_add_arc(CBB *cbb, uint64_t arc) oid_add_arc(CBB *cbb, uint64_t arc)
@ -367,6 +370,7 @@ a2d_ASN1_OBJECT(unsigned char *out, int out_len, const char *in, int in_len)
return ret; return ret;
} }
LCRYPTO_ALIAS(a2d_ASN1_OBJECT);
static int static int
i2t_ASN1_OBJECT_oid(const ASN1_OBJECT *aobj, CBB *cbb) i2t_ASN1_OBJECT_oid(const ASN1_OBJECT *aobj, CBB *cbb)
@ -456,6 +460,7 @@ i2t_ASN1_OBJECT(char *buf, int buf_len, const ASN1_OBJECT *aobj)
{ {
return i2t_ASN1_OBJECT_internal(aobj, buf, buf_len, 0); return i2t_ASN1_OBJECT_internal(aobj, buf, buf_len, 0);
} }
LCRYPTO_ALIAS(i2t_ASN1_OBJECT);
ASN1_OBJECT * ASN1_OBJECT *
t2i_ASN1_OBJECT_internal(const char *oid) t2i_ASN1_OBJECT_internal(const char *oid)
@ -523,6 +528,7 @@ i2a_ASN1_OBJECT(BIO *bp, const ASN1_OBJECT *aobj)
return ret; return ret;
} }
LCRYPTO_ALIAS(i2a_ASN1_OBJECT);
int int
c2i_ASN1_OBJECT_cbs(ASN1_OBJECT **out_aobj, CBS *content) c2i_ASN1_OBJECT_cbs(ASN1_OBJECT **out_aobj, CBS *content)
@ -627,6 +633,7 @@ i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp)
*pp = p; *pp = p;
return (objsize); return (objsize);
} }
LCRYPTO_ALIAS(i2d_ASN1_OBJECT);
ASN1_OBJECT * ASN1_OBJECT *
d2i_ASN1_OBJECT(ASN1_OBJECT **out_aobj, const unsigned char **pp, long length) d2i_ASN1_OBJECT(ASN1_OBJECT **out_aobj, const unsigned char **pp, long length)
@ -666,3 +673,4 @@ d2i_ASN1_OBJECT(ASN1_OBJECT **out_aobj, const unsigned char **pp, long length)
return aobj; return aobj;
} }
LCRYPTO_ALIAS(d2i_ASN1_OBJECT);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: a_octet.c,v 1.11 2021/12/25 08:52:44 jsing Exp $ */ /* $OpenBSD: a_octet.c,v 1.12 2023/07/05 21:23:36 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -72,12 +72,14 @@ ASN1_OCTET_STRING_new(void)
{ {
return (ASN1_OCTET_STRING *)ASN1_item_new(&ASN1_OCTET_STRING_it); return (ASN1_OCTET_STRING *)ASN1_item_new(&ASN1_OCTET_STRING_it);
} }
LCRYPTO_ALIAS(ASN1_OCTET_STRING_new);
void void
ASN1_OCTET_STRING_free(ASN1_OCTET_STRING *a) ASN1_OCTET_STRING_free(ASN1_OCTET_STRING *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &ASN1_OCTET_STRING_it); ASN1_item_free((ASN1_VALUE *)a, &ASN1_OCTET_STRING_it);
} }
LCRYPTO_ALIAS(ASN1_OCTET_STRING_free);
ASN1_OCTET_STRING * ASN1_OCTET_STRING *
@ -85,24 +87,28 @@ ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *x)
{ {
return ASN1_STRING_dup(x); return ASN1_STRING_dup(x);
} }
LCRYPTO_ALIAS(ASN1_OCTET_STRING_dup);
int int
ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, const ASN1_OCTET_STRING *b) ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, const ASN1_OCTET_STRING *b)
{ {
return ASN1_STRING_cmp(a, b); return ASN1_STRING_cmp(a, b);
} }
LCRYPTO_ALIAS(ASN1_OCTET_STRING_cmp);
int int
ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, const unsigned char *d, int len) ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, const unsigned char *d, int len)
{ {
return ASN1_STRING_set(x, d, len); return ASN1_STRING_set(x, d, len);
} }
LCRYPTO_ALIAS(ASN1_OCTET_STRING_set);
int int
i2d_ASN1_OCTET_STRING(ASN1_OCTET_STRING *a, unsigned char **out) i2d_ASN1_OCTET_STRING(ASN1_OCTET_STRING *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_OCTET_STRING_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_OCTET_STRING_it);
} }
LCRYPTO_ALIAS(i2d_ASN1_OCTET_STRING);
ASN1_OCTET_STRING * ASN1_OCTET_STRING *
d2i_ASN1_OCTET_STRING(ASN1_OCTET_STRING **a, const unsigned char **in, long len) d2i_ASN1_OCTET_STRING(ASN1_OCTET_STRING **a, const unsigned char **in, long len)
@ -110,3 +116,4 @@ d2i_ASN1_OCTET_STRING(ASN1_OCTET_STRING **a, const unsigned char **in, long len)
return (ASN1_OCTET_STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_OCTET_STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ASN1_OCTET_STRING_it); &ASN1_OCTET_STRING_it);
} }
LCRYPTO_ALIAS(d2i_ASN1_OCTET_STRING);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: a_pkey.c,v 1.4 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: a_pkey.c,v 1.5 2023/07/05 21:23:36 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -123,6 +123,7 @@ d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp, long length)
EVP_PKEY_free(ret); EVP_PKEY_free(ret);
return (NULL); return (NULL);
} }
LCRYPTO_ALIAS(d2i_PrivateKey);
int int
i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp) i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp)
@ -139,6 +140,7 @@ i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp)
ASN1error(ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE); ASN1error(ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE);
return (-1); return (-1);
} }
LCRYPTO_ALIAS(i2d_PrivateKey);
/* This works like d2i_PrivateKey() except it automatically works out the type */ /* This works like d2i_PrivateKey() except it automatically works out the type */
@ -184,3 +186,4 @@ d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp, long length)
sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free); sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free);
return d2i_PrivateKey(keytype, a, pp, length); return d2i_PrivateKey(keytype, a, pp, length);
} }
LCRYPTO_ALIAS(d2i_AutoPrivateKey);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: a_print.c,v 1.12 2023/03/12 11:49:02 tb Exp $ */ /* $OpenBSD: a_print.c,v 1.13 2023/07/05 21:23:36 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -94,6 +94,7 @@ ASN1_PRINTABLE_type(const unsigned char *s, int len)
return (V_ASN1_IA5STRING); return (V_ASN1_IA5STRING);
return (V_ASN1_PRINTABLESTRING); return (V_ASN1_PRINTABLESTRING);
} }
LCRYPTO_ALIAS(ASN1_PRINTABLE_type);
int int
ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s) ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s)
@ -123,3 +124,4 @@ ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s)
s->type = ASN1_PRINTABLE_type(s->data, s->length); s->type = ASN1_PRINTABLE_type(s->data, s->length);
return (1); return (1);
} }
LCRYPTO_ALIAS(ASN1_UNIVERSALSTRING_to_string);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: a_pubkey.c,v 1.4 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: a_pubkey.c,v 1.5 2023/07/05 21:23:36 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -136,6 +136,7 @@ d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, long length)
EVP_PKEY_free(ret); EVP_PKEY_free(ret);
return (NULL); return (NULL);
} }
LCRYPTO_ALIAS(d2i_PublicKey);
int int
i2d_PublicKey(EVP_PKEY *a, unsigned char **pp) i2d_PublicKey(EVP_PKEY *a, unsigned char **pp)
@ -158,3 +159,4 @@ i2d_PublicKey(EVP_PKEY *a, unsigned char **pp)
return (-1); return (-1);
} }
} }
LCRYPTO_ALIAS(i2d_PublicKey);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: a_strex.c,v 1.32 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: a_strex.c,v 1.33 2023/07/05 21:23:36 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000. * project 2000.
*/ */
@ -570,6 +570,7 @@ X509_NAME_print_ex(BIO *out, const X509_NAME *nm, int indent,
return X509_NAME_print(out, nm, indent); return X509_NAME_print(out, nm, indent);
return do_name_ex(send_bio_chars, out, nm, indent, flags); return do_name_ex(send_bio_chars, out, nm, indent, flags);
} }
LCRYPTO_ALIAS(X509_NAME_print_ex);
int int
X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, int indent, X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, int indent,
@ -587,15 +588,18 @@ X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, int indent,
} }
return do_name_ex(send_fp_chars, fp, nm, indent, flags); return do_name_ex(send_fp_chars, fp, nm, indent, flags);
} }
LCRYPTO_ALIAS(X509_NAME_print_ex_fp);
int int
ASN1_STRING_print_ex(BIO *out, const ASN1_STRING *str, unsigned long flags) ASN1_STRING_print_ex(BIO *out, const ASN1_STRING *str, unsigned long flags)
{ {
return do_print_ex(send_bio_chars, out, flags, str); return do_print_ex(send_bio_chars, out, flags, str);
} }
LCRYPTO_ALIAS(ASN1_STRING_print_ex);
int int
ASN1_STRING_print_ex_fp(FILE *fp, const ASN1_STRING *str, unsigned long flags) ASN1_STRING_print_ex_fp(FILE *fp, const ASN1_STRING *str, unsigned long flags)
{ {
return do_print_ex(send_fp_chars, fp, flags, str); return do_print_ex(send_fp_chars, fp, flags, str);
} }
LCRYPTO_ALIAS(ASN1_STRING_print_ex_fp);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: a_string.c,v 1.13 2022/11/28 07:50:47 tb Exp $ */ /* $OpenBSD: a_string.c,v 1.14 2023/07/05 21:23:36 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -70,6 +70,7 @@ ASN1_STRING_new(void)
{ {
return ASN1_STRING_type_new(V_ASN1_OCTET_STRING); return ASN1_STRING_type_new(V_ASN1_OCTET_STRING);
} }
LCRYPTO_ALIAS(ASN1_STRING_new);
ASN1_STRING * ASN1_STRING *
ASN1_STRING_type_new(int type) ASN1_STRING_type_new(int type)
@ -84,6 +85,7 @@ ASN1_STRING_type_new(int type)
return astr; return astr;
} }
LCRYPTO_ALIAS(ASN1_STRING_type_new);
static void static void
ASN1_STRING_clear(ASN1_STRING *astr) ASN1_STRING_clear(ASN1_STRING *astr)
@ -106,6 +108,7 @@ ASN1_STRING_free(ASN1_STRING *astr)
free(astr); free(astr);
} }
LCRYPTO_ALIAS(ASN1_STRING_free);
int int
ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b) ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b)
@ -121,6 +124,7 @@ ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b)
return (a->type - b->type); return (a->type - b->type);
} }
LCRYPTO_ALIAS(ASN1_STRING_cmp);
int int
ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *src) ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *src)
@ -136,6 +140,7 @@ ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *src)
return 1; return 1;
} }
LCRYPTO_ALIAS(ASN1_STRING_copy);
ASN1_STRING * ASN1_STRING *
ASN1_STRING_dup(const ASN1_STRING *src) ASN1_STRING_dup(const ASN1_STRING *src)
@ -153,6 +158,7 @@ ASN1_STRING_dup(const ASN1_STRING *src)
} }
return astr; return astr;
} }
LCRYPTO_ALIAS(ASN1_STRING_dup);
int int
ASN1_STRING_set(ASN1_STRING *astr, const void *_data, int len) ASN1_STRING_set(ASN1_STRING *astr, const void *_data, int len)
@ -189,6 +195,7 @@ ASN1_STRING_set(ASN1_STRING *astr, const void *_data, int len)
return 1; return 1;
} }
LCRYPTO_ALIAS(ASN1_STRING_set);
void void
ASN1_STRING_set0(ASN1_STRING *astr, void *data, int len) ASN1_STRING_set0(ASN1_STRING *astr, void *data, int len)
@ -198,12 +205,14 @@ ASN1_STRING_set0(ASN1_STRING *astr, void *data, int len)
astr->data = data; astr->data = data;
astr->length = len; astr->length = len;
} }
LCRYPTO_ALIAS(ASN1_STRING_set0);
int int
ASN1_STRING_length(const ASN1_STRING *astr) ASN1_STRING_length(const ASN1_STRING *astr)
{ {
return astr->length; return astr->length;
} }
LCRYPTO_ALIAS(ASN1_STRING_length);
void void
ASN1_STRING_length_set(ASN1_STRING *astr, int len) ASN1_STRING_length_set(ASN1_STRING *astr, int len)
@ -211,24 +220,28 @@ ASN1_STRING_length_set(ASN1_STRING *astr, int len)
/* This is dangerous and unfixable. */ /* This is dangerous and unfixable. */
astr->length = len; astr->length = len;
} }
LCRYPTO_ALIAS(ASN1_STRING_length_set);
int int
ASN1_STRING_type(const ASN1_STRING *astr) ASN1_STRING_type(const ASN1_STRING *astr)
{ {
return astr->type; return astr->type;
} }
LCRYPTO_ALIAS(ASN1_STRING_type);
unsigned char * unsigned char *
ASN1_STRING_data(ASN1_STRING *astr) ASN1_STRING_data(ASN1_STRING *astr)
{ {
return astr->data; return astr->data;
} }
LCRYPTO_ALIAS(ASN1_STRING_data);
const unsigned char * const unsigned char *
ASN1_STRING_get0_data(const ASN1_STRING *astr) ASN1_STRING_get0_data(const ASN1_STRING *astr)
{ {
return astr->data; return astr->data;
} }
LCRYPTO_ALIAS(ASN1_STRING_get0_data);
int int
ASN1_STRING_print(BIO *bp, const ASN1_STRING *astr) ASN1_STRING_print(BIO *bp, const ASN1_STRING *astr)
@ -262,6 +275,7 @@ ASN1_STRING_print(BIO *bp, const ASN1_STRING *astr)
return 1; return 1;
} }
LCRYPTO_ALIAS(ASN1_STRING_print);
/* /*
* Utility function: convert any string type to UTF8, returns number of bytes * Utility function: convert any string type to UTF8, returns number of bytes
@ -304,6 +318,7 @@ ASN1_STRING_to_UTF8(unsigned char **out, const ASN1_STRING *in)
return ret; return ret;
} }
LCRYPTO_ALIAS(ASN1_STRING_to_UTF8);
int int
i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *astr, int type) i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *astr, int type)
@ -338,6 +353,7 @@ i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *astr, int type)
err: err:
return -1; return -1;
} }
LCRYPTO_ALIAS(i2a_ASN1_STRING);
int int
a2i_ASN1_STRING(BIO *bp, ASN1_STRING *astr, char *buf, int size) a2i_ASN1_STRING(BIO *bp, ASN1_STRING *astr, char *buf, int size)
@ -429,3 +445,4 @@ a2i_ASN1_STRING(BIO *bp, ASN1_STRING *astr, char *buf, int size)
return ret; return ret;
} }
LCRYPTO_ALIAS(a2i_ASN1_STRING);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: a_strnid.c,v 1.25 2021/12/13 17:55:53 schwarze Exp $ */ /* $OpenBSD: a_strnid.c,v 1.27 2023/07/05 21:23:36 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999. * project 1999.
*/ */
@ -86,12 +86,14 @@ ASN1_STRING_set_default_mask(unsigned long mask)
{ {
global_mask = mask; global_mask = mask;
} }
LCRYPTO_ALIAS(ASN1_STRING_set_default_mask);
unsigned long unsigned long
ASN1_STRING_get_default_mask(void) ASN1_STRING_get_default_mask(void)
{ {
return global_mask; return global_mask;
} }
LCRYPTO_ALIAS(ASN1_STRING_get_default_mask);
/* /*
* This function sets the default to various "flavours" of configuration * This function sets the default to various "flavours" of configuration
@ -134,6 +136,7 @@ ASN1_STRING_set_default_mask_asc(const char *p)
ASN1_STRING_set_default_mask(mask); ASN1_STRING_set_default_mask(mask);
return 1; return 1;
} }
LCRYPTO_ALIAS(ASN1_STRING_set_default_mask_asc);
/* /*
* The following function generates an ASN1_STRING based on limits in a table. * The following function generates an ASN1_STRING based on limits in a table.
@ -166,6 +169,7 @@ ASN1_STRING_set_by_NID(ASN1_STRING **out, const unsigned char *in, int inlen,
return NULL; return NULL;
return *out; return *out;
} }
LCRYPTO_ALIAS(ASN1_STRING_set_by_NID);
/* /*
* Now the tables and helper functions for the string table: * Now the tables and helper functions for the string table:
@ -187,25 +191,139 @@ ASN1_STRING_set_by_NID(ASN1_STRING **out, const unsigned char *in, int inlen,
/* This table must be kept in NID order */ /* This table must be kept in NID order */
static const ASN1_STRING_TABLE tbl_standard[] = { static const ASN1_STRING_TABLE tbl_standard[] = {
{NID_commonName, 1, ub_common_name, DIRSTRING_TYPE, 0}, {
{NID_countryName, 2, 2, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK}, .nid = NID_commonName,
{NID_localityName, 1, ub_locality_name, DIRSTRING_TYPE, 0}, .minsize = 1,
{NID_stateOrProvinceName, 1, ub_state_name, DIRSTRING_TYPE, 0}, .maxsize = ub_common_name,
{NID_organizationName, 1, ub_organization_name, DIRSTRING_TYPE, 0}, .mask = DIRSTRING_TYPE,
{NID_organizationalUnitName, 1, ub_organization_unit_name, DIRSTRING_TYPE, 0}, .flags = 0,
{NID_pkcs9_emailAddress, 1, ub_email_address, B_ASN1_IA5STRING, STABLE_NO_MASK}, },
{NID_pkcs9_unstructuredName, 1, -1, PKCS9STRING_TYPE, 0}, {
{NID_pkcs9_challengePassword, 1, -1, PKCS9STRING_TYPE, 0}, .nid = NID_countryName,
{NID_pkcs9_unstructuredAddress, 1, -1, DIRSTRING_TYPE, 0}, .minsize = 2,
{NID_givenName, 1, ub_name, DIRSTRING_TYPE, 0}, .maxsize = 2,
{NID_surname, 1, ub_name, DIRSTRING_TYPE, 0}, .mask = B_ASN1_PRINTABLESTRING,
{NID_initials, 1, ub_name, DIRSTRING_TYPE, 0}, .flags = STABLE_NO_MASK,
{NID_serialNumber, 1, ub_serial_number, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK}, },
{NID_friendlyName, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK}, {
{NID_name, 1, ub_name, DIRSTRING_TYPE, 0}, .nid = NID_localityName,
{NID_dnQualifier, -1, -1, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK}, .minsize = 1,
{NID_domainComponent, 1, -1, B_ASN1_IA5STRING, STABLE_NO_MASK}, .maxsize = ub_locality_name,
{NID_ms_csp_name, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK} .mask = DIRSTRING_TYPE,
.flags = 0,
},
{
.nid = NID_stateOrProvinceName,
.minsize = 1,
.maxsize = ub_state_name,
.mask = DIRSTRING_TYPE,
.flags = 0,
},
{
.nid = NID_organizationName,
.minsize = 1,
.maxsize = ub_organization_name,
.mask = DIRSTRING_TYPE,
.flags = 0,
},
{
.nid = NID_organizationalUnitName,
.minsize = 1,
.maxsize = ub_organization_unit_name,
.mask = DIRSTRING_TYPE,
.flags = 0,
},
{
.nid = NID_pkcs9_emailAddress,
.minsize = 1,
.maxsize = ub_email_address,
.mask = B_ASN1_IA5STRING,
.flags = STABLE_NO_MASK,
},
{
.nid = NID_pkcs9_unstructuredName,
.minsize = 1,
.maxsize = -1,
.mask = PKCS9STRING_TYPE,
.flags = 0,
},
{
.nid = NID_pkcs9_challengePassword,
.minsize = 1,
.maxsize = -1,
.mask = PKCS9STRING_TYPE,
.flags = 0,
},
{
.nid = NID_pkcs9_unstructuredAddress,
.minsize = 1,
.maxsize = -1,
.mask = DIRSTRING_TYPE,
.flags = 0,
},
{
.nid = NID_givenName,
.minsize = 1,
.maxsize = ub_name,
.mask = DIRSTRING_TYPE,
.flags = 0,
},
{
.nid = NID_surname,
.minsize = 1,
.maxsize = ub_name,
.mask = DIRSTRING_TYPE,
.flags = 0,
},
{
.nid = NID_initials,
.minsize = 1,
.maxsize = ub_name,
.mask = DIRSTRING_TYPE,
.flags = 0,
},
{
.nid = NID_serialNumber,
.minsize = 1,
.maxsize = ub_serial_number,
.mask = B_ASN1_PRINTABLESTRING,
.flags = STABLE_NO_MASK,
},
{
.nid = NID_friendlyName,
.minsize = -1,
.maxsize = -1,
.mask = B_ASN1_BMPSTRING,
.flags = STABLE_NO_MASK,
},
{
.nid = NID_name,
.minsize = 1,
.maxsize = ub_name,
.mask = DIRSTRING_TYPE,
.flags = 0,
},
{
.nid = NID_dnQualifier,
.minsize = -1,
.maxsize = -1,
.mask = B_ASN1_PRINTABLESTRING,
.flags = STABLE_NO_MASK,
},
{
.nid = NID_domainComponent,
.minsize = 1,
.maxsize = -1,
.mask = B_ASN1_IA5STRING,
.flags = STABLE_NO_MASK,
},
{
.nid = NID_ms_csp_name,
.minsize = -1,
.maxsize = -1,
.mask = B_ASN1_BMPSTRING,
.flags = STABLE_NO_MASK,
},
}; };
static int static int
@ -254,8 +372,9 @@ ASN1_STRING_TABLE_get(int nid)
return sk_ASN1_STRING_TABLE_value(stable, idx); return sk_ASN1_STRING_TABLE_value(stable, idx);
} }
return OBJ_bsearch_table(&fnd, tbl_standard, return OBJ_bsearch_table(&fnd, tbl_standard,
sizeof(tbl_standard)/sizeof(ASN1_STRING_TABLE)); sizeof(tbl_standard) / sizeof(tbl_standard[0]));
} }
LCRYPTO_ALIAS(ASN1_STRING_TABLE_get);
/* /*
* Return a string table pointer which can be modified: either directly * Return a string table pointer which can be modified: either directly
@ -321,6 +440,7 @@ ASN1_STRING_TABLE_add(int nid, long minsize, long maxsize, unsigned long mask,
return 1; return 1;
} }
LCRYPTO_ALIAS(ASN1_STRING_TABLE_add);
void void
ASN1_STRING_TABLE_cleanup(void) ASN1_STRING_TABLE_cleanup(void)
@ -333,6 +453,7 @@ ASN1_STRING_TABLE_cleanup(void)
stable = NULL; stable = NULL;
sk_ASN1_STRING_TABLE_pop_free(tmp, st_free); sk_ASN1_STRING_TABLE_pop_free(tmp, st_free);
} }
LCRYPTO_ALIAS(ASN1_STRING_TABLE_cleanup);
static void static void
st_free(ASN1_STRING_TABLE *tbl) st_free(ASN1_STRING_TABLE *tbl)

View file

@ -1,4 +1,4 @@
/* $OpenBSD: a_time.c,v 1.36 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: a_time.c,v 1.37 2023/07/05 21:23:36 beck Exp $ */
/* ==================================================================== /* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved. * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
* *
@ -84,12 +84,14 @@ ASN1_TIME_new(void)
{ {
return (ASN1_TIME *)ASN1_item_new(&ASN1_TIME_it); return (ASN1_TIME *)ASN1_item_new(&ASN1_TIME_it);
} }
LCRYPTO_ALIAS(ASN1_TIME_new);
void void
ASN1_TIME_free(ASN1_TIME *a) ASN1_TIME_free(ASN1_TIME *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &ASN1_TIME_it); ASN1_item_free((ASN1_VALUE *)a, &ASN1_TIME_it);
} }
LCRYPTO_ALIAS(ASN1_TIME_free);
int int
ASN1_TIME_to_tm(const ASN1_TIME *s, struct tm *tm) ASN1_TIME_to_tm(const ASN1_TIME *s, struct tm *tm)
@ -104,6 +106,7 @@ ASN1_TIME_to_tm(const ASN1_TIME *s, struct tm *tm)
return asn1_time_time_t_to_tm(&now, tm); return asn1_time_time_t_to_tm(&now, tm);
} }
LCRYPTO_ALIAS(ASN1_TIME_to_tm);
int int
ASN1_TIME_diff(int *pday, int *psec, const ASN1_TIME *from, const ASN1_TIME *to) ASN1_TIME_diff(int *pday, int *psec, const ASN1_TIME *from, const ASN1_TIME *to)
@ -117,6 +120,7 @@ ASN1_TIME_diff(int *pday, int *psec, const ASN1_TIME *from, const ASN1_TIME *to)
return OPENSSL_gmtime_diff(pday, psec, &tm_from, &tm_to); return OPENSSL_gmtime_diff(pday, psec, &tm_from, &tm_to);
} }
LCRYPTO_ALIAS(ASN1_TIME_diff);
ASN1_TIME * ASN1_TIME *
d2i_ASN1_TIME(ASN1_TIME **a, const unsigned char **in, long len) d2i_ASN1_TIME(ASN1_TIME **a, const unsigned char **in, long len)
@ -124,9 +128,11 @@ d2i_ASN1_TIME(ASN1_TIME **a, const unsigned char **in, long len)
return (ASN1_TIME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_TIME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ASN1_TIME_it); &ASN1_TIME_it);
} }
LCRYPTO_ALIAS(d2i_ASN1_TIME);
int int
i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **out) i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_TIME_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_TIME_it);
} }
LCRYPTO_ALIAS(i2d_ASN1_TIME);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: a_time_tm.c,v 1.27 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: a_time_tm.c,v 1.28 2023/07/05 21:23:36 beck Exp $ */
/* /*
* Copyright (c) 2015 Bob Beck <beck@openbsd.org> * Copyright (c) 2015 Bob Beck <beck@openbsd.org>
* *
@ -60,6 +60,7 @@ ASN1_time_tm_cmp(struct tm *tm1, struct tm *tm2)
return (1); return (1);
return 0; return 0;
} }
LCRYPTO_ALIAS(ASN1_time_tm_cmp);
int int
ASN1_time_tm_clamp_notafter(struct tm *tm) ASN1_time_tm_clamp_notafter(struct tm *tm)
@ -76,6 +77,7 @@ ASN1_time_tm_clamp_notafter(struct tm *tm)
#endif #endif
return 1; return 1;
} }
LCRYPTO_ALIAS(ASN1_time_tm_clamp_notafter);
/* Convert time to GeneralizedTime, X.690, 11.7. */ /* Convert time to GeneralizedTime, X.690, 11.7. */
ASN1_TIME * ASN1_TIME *
@ -344,6 +346,7 @@ ASN1_time_parse(const char *bytes, size_t len, struct tm *tm, int mode)
return -1; return -1;
} }
LCRYPTO_ALIAS(ASN1_time_parse);
/* /*
* ASN1_TIME generic functions. * ASN1_TIME generic functions.
@ -404,6 +407,7 @@ ASN1_TIME_set(ASN1_TIME *s, time_t t)
{ {
return (ASN1_TIME_adj(s, t, 0, 0)); return (ASN1_TIME_adj(s, t, 0, 0));
} }
LCRYPTO_ALIAS(ASN1_TIME_set);
ASN1_TIME * ASN1_TIME *
ASN1_TIME_set_tm(ASN1_TIME *s, struct tm *tm) ASN1_TIME_set_tm(ASN1_TIME *s, struct tm *tm)
@ -414,12 +418,14 @@ ASN1_TIME_set_tm(ASN1_TIME *s, struct tm *tm)
return NULL; return NULL;
return (ASN1_TIME_adj(s, t, 0, 0)); return (ASN1_TIME_adj(s, t, 0, 0));
} }
LCRYPTO_ALIAS(ASN1_TIME_set_tm);
ASN1_TIME * ASN1_TIME *
ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, long offset_sec) ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, long offset_sec)
{ {
return (ASN1_TIME_adj_internal(s, t, offset_day, offset_sec, RFC5280)); return (ASN1_TIME_adj_internal(s, t, offset_day, offset_sec, RFC5280));
} }
LCRYPTO_ALIAS(ASN1_TIME_adj);
int int
ASN1_TIME_check(const ASN1_TIME *t) ASN1_TIME_check(const ASN1_TIME *t)
@ -428,6 +434,7 @@ ASN1_TIME_check(const ASN1_TIME *t)
return (0); return (0);
return (t->type == ASN1_time_parse(t->data, t->length, NULL, t->type)); return (t->type == ASN1_time_parse(t->data, t->length, NULL, t->type));
} }
LCRYPTO_ALIAS(ASN1_TIME_check);
ASN1_GENERALIZEDTIME * ASN1_GENERALIZEDTIME *
ASN1_TIME_to_generalizedtime(const ASN1_TIME *t, ASN1_GENERALIZEDTIME **out) ASN1_TIME_to_generalizedtime(const ASN1_TIME *t, ASN1_GENERALIZEDTIME **out)
@ -450,12 +457,14 @@ ASN1_TIME_to_generalizedtime(const ASN1_TIME *t, ASN1_GENERALIZEDTIME **out)
return (agt); return (agt);
} }
LCRYPTO_ALIAS(ASN1_TIME_to_generalizedtime);
int int
ASN1_TIME_set_string(ASN1_TIME *s, const char *str) ASN1_TIME_set_string(ASN1_TIME *s, const char *str)
{ {
return (ASN1_TIME_set_string_internal(s, str, 0)); return (ASN1_TIME_set_string_internal(s, str, 0));
} }
LCRYPTO_ALIAS(ASN1_TIME_set_string);
static int static int
ASN1_TIME_cmp_time_t_internal(const ASN1_TIME *s, time_t t2, int mode) ASN1_TIME_cmp_time_t_internal(const ASN1_TIME *s, time_t t2, int mode)
@ -500,6 +509,7 @@ ASN1_TIME_compare(const ASN1_TIME *t1, const ASN1_TIME *t2)
return ASN1_time_tm_cmp(&tm1, &tm2); return ASN1_time_tm_cmp(&tm1, &tm2);
} }
LCRYPTO_ALIAS(ASN1_TIME_compare);
int int
ASN1_TIME_cmp_time_t(const ASN1_TIME *s, time_t t) ASN1_TIME_cmp_time_t(const ASN1_TIME *s, time_t t)
@ -511,6 +521,7 @@ ASN1_TIME_cmp_time_t(const ASN1_TIME *s, time_t t)
V_ASN1_GENERALIZEDTIME); V_ASN1_GENERALIZEDTIME);
return -2; return -2;
} }
LCRYPTO_ALIAS(ASN1_TIME_cmp_time_t);
/* /*
* ASN1_UTCTIME wrappers * ASN1_UTCTIME wrappers
@ -523,6 +534,7 @@ ASN1_UTCTIME_check(const ASN1_UTCTIME *d)
return (0); return (0);
return (d->type == ASN1_time_parse(d->data, d->length, NULL, d->type)); return (d->type == ASN1_time_parse(d->data, d->length, NULL, d->type));
} }
LCRYPTO_ALIAS(ASN1_UTCTIME_check);
int int
ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str) ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str)
@ -531,12 +543,14 @@ ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str)
return (0); return (0);
return (ASN1_TIME_set_string_internal(s, str, V_ASN1_UTCTIME)); return (ASN1_TIME_set_string_internal(s, str, V_ASN1_UTCTIME));
} }
LCRYPTO_ALIAS(ASN1_UTCTIME_set_string);
ASN1_UTCTIME * ASN1_UTCTIME *
ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t) ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
{ {
return (ASN1_UTCTIME_adj(s, t, 0, 0)); return (ASN1_UTCTIME_adj(s, t, 0, 0));
} }
LCRYPTO_ALIAS(ASN1_UTCTIME_set);
ASN1_UTCTIME * ASN1_UTCTIME *
ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, int offset_day, long offset_sec) ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, int offset_day, long offset_sec)
@ -544,6 +558,7 @@ ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, int offset_day, long offset_sec)
return (ASN1_TIME_adj_internal(s, t, offset_day, offset_sec, return (ASN1_TIME_adj_internal(s, t, offset_day, offset_sec,
V_ASN1_UTCTIME)); V_ASN1_UTCTIME));
} }
LCRYPTO_ALIAS(ASN1_UTCTIME_adj);
int int
ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t) ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t)
@ -552,6 +567,7 @@ ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t)
return ASN1_TIME_cmp_time_t_internal(s, t, V_ASN1_UTCTIME); return ASN1_TIME_cmp_time_t_internal(s, t, V_ASN1_UTCTIME);
return -2; return -2;
} }
LCRYPTO_ALIAS(ASN1_UTCTIME_cmp_time_t);
/* /*
* ASN1_GENERALIZEDTIME wrappers * ASN1_GENERALIZEDTIME wrappers
@ -564,6 +580,7 @@ ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *d)
return (0); return (0);
return (d->type == ASN1_time_parse(d->data, d->length, NULL, d->type)); return (d->type == ASN1_time_parse(d->data, d->length, NULL, d->type));
} }
LCRYPTO_ALIAS(ASN1_GENERALIZEDTIME_check);
int int
ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str) ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str)
@ -572,12 +589,14 @@ ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str)
return (0); return (0);
return (ASN1_TIME_set_string_internal(s, str, V_ASN1_GENERALIZEDTIME)); return (ASN1_TIME_set_string_internal(s, str, V_ASN1_GENERALIZEDTIME));
} }
LCRYPTO_ALIAS(ASN1_GENERALIZEDTIME_set_string);
ASN1_GENERALIZEDTIME * ASN1_GENERALIZEDTIME *
ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, time_t t) ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, time_t t)
{ {
return (ASN1_GENERALIZEDTIME_adj(s, t, 0, 0)); return (ASN1_GENERALIZEDTIME_adj(s, t, 0, 0));
} }
LCRYPTO_ALIAS(ASN1_GENERALIZEDTIME_set);
ASN1_GENERALIZEDTIME * ASN1_GENERALIZEDTIME *
ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, time_t t, int offset_day, ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, time_t t, int offset_day,
@ -586,6 +605,7 @@ ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, time_t t, int offset_day,
return (ASN1_TIME_adj_internal(s, t, offset_day, offset_sec, return (ASN1_TIME_adj_internal(s, t, offset_day, offset_sec,
V_ASN1_GENERALIZEDTIME)); V_ASN1_GENERALIZEDTIME));
} }
LCRYPTO_ALIAS(ASN1_GENERALIZEDTIME_adj);
int int
ASN1_TIME_normalize(ASN1_TIME *t) ASN1_TIME_normalize(ASN1_TIME *t)
@ -596,9 +616,11 @@ ASN1_TIME_normalize(ASN1_TIME *t)
return 0; return 0;
return tm_to_rfc5280_time(&tm, t) != NULL; return tm_to_rfc5280_time(&tm, t) != NULL;
} }
LCRYPTO_ALIAS(ASN1_TIME_normalize);
int int
ASN1_TIME_set_string_X509(ASN1_TIME *s, const char *str) ASN1_TIME_set_string_X509(ASN1_TIME *s, const char *str)
{ {
return ASN1_TIME_set_string_internal(s, str, RFC5280); return ASN1_TIME_set_string_internal(s, str, RFC5280);
} }
LCRYPTO_ALIAS(ASN1_TIME_set_string_X509);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: a_type.c,v 1.25 2023/03/11 14:05:02 jsing Exp $ */ /* $OpenBSD: a_type.c,v 1.26 2023/07/05 21:23:36 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -94,12 +94,14 @@ ASN1_TYPE_new(void)
{ {
return (ASN1_TYPE *)ASN1_item_new(&ASN1_ANY_it); return (ASN1_TYPE *)ASN1_item_new(&ASN1_ANY_it);
} }
LCRYPTO_ALIAS(ASN1_TYPE_new);
void void
ASN1_TYPE_free(ASN1_TYPE *a) ASN1_TYPE_free(ASN1_TYPE *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &ASN1_ANY_it); ASN1_item_free((ASN1_VALUE *)a, &ASN1_ANY_it);
} }
LCRYPTO_ALIAS(ASN1_TYPE_free);
int int
ASN1_TYPE_get(const ASN1_TYPE *a) ASN1_TYPE_get(const ASN1_TYPE *a)
@ -113,6 +115,7 @@ ASN1_TYPE_get(const ASN1_TYPE *a)
return 0; return 0;
} }
LCRYPTO_ALIAS(ASN1_TYPE_get);
void void
ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value) ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value)
@ -127,6 +130,7 @@ ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value)
else else
a->value.ptr = value; a->value.ptr = value;
} }
LCRYPTO_ALIAS(ASN1_TYPE_set);
int int
ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value) ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value)
@ -149,6 +153,7 @@ ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value)
} }
return 1; return 1;
} }
LCRYPTO_ALIAS(ASN1_TYPE_set1);
/* Returns 0 if they are equal, != 0 otherwise. */ /* Returns 0 if they are equal, != 0 otherwise. */
int int
@ -198,6 +203,7 @@ ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b)
return result; return result;
} }
LCRYPTO_ALIAS(ASN1_TYPE_cmp);
int int
ASN1_TYPE_set_octetstring(ASN1_TYPE *a, const unsigned char *data, int len) ASN1_TYPE_set_octetstring(ASN1_TYPE *a, const unsigned char *data, int len)
@ -213,6 +219,7 @@ ASN1_TYPE_set_octetstring(ASN1_TYPE *a, const unsigned char *data, int len)
ASN1_TYPE_set(a, V_ASN1_OCTET_STRING, os); ASN1_TYPE_set(a, V_ASN1_OCTET_STRING, os);
return (1); return (1);
} }
LCRYPTO_ALIAS(ASN1_TYPE_set_octetstring);
int int
ASN1_TYPE_get_octetstring(const ASN1_TYPE *a, unsigned char *data, int max_len) ASN1_TYPE_get_octetstring(const ASN1_TYPE *a, unsigned char *data, int max_len)
@ -234,6 +241,7 @@ ASN1_TYPE_get_octetstring(const ASN1_TYPE *a, unsigned char *data, int max_len)
memcpy(data, p, num); memcpy(data, p, num);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(ASN1_TYPE_get_octetstring);
int int
ASN1_TYPE_set_int_octetstring(ASN1_TYPE *at, long num, const unsigned char *data, ASN1_TYPE_set_int_octetstring(ASN1_TYPE *at, long num, const unsigned char *data,
@ -265,6 +273,7 @@ ASN1_TYPE_set_int_octetstring(ASN1_TYPE *at, long num, const unsigned char *data
return ret; return ret;
} }
LCRYPTO_ALIAS(ASN1_TYPE_set_int_octetstring);
int int
ASN1_TYPE_get_int_octetstring(const ASN1_TYPE *at, long *num, unsigned char *data, ASN1_TYPE_get_int_octetstring(const ASN1_TYPE *at, long *num, unsigned char *data,
@ -300,6 +309,7 @@ ASN1_TYPE_get_int_octetstring(const ASN1_TYPE *at, long *num, unsigned char *dat
return ret; return ret;
} }
LCRYPTO_ALIAS(ASN1_TYPE_get_int_octetstring);
ASN1_TYPE * ASN1_TYPE *
ASN1_TYPE_pack_sequence(const ASN1_ITEM *it, void *s, ASN1_TYPE **t) ASN1_TYPE_pack_sequence(const ASN1_ITEM *it, void *s, ASN1_TYPE **t)
@ -337,6 +347,7 @@ i2d_ASN1_TYPE(ASN1_TYPE *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_ANY_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_ANY_it);
} }
LCRYPTO_ALIAS(i2d_ASN1_TYPE);
ASN1_TYPE * ASN1_TYPE *
d2i_ASN1_TYPE(ASN1_TYPE **a, const unsigned char **in, long len) d2i_ASN1_TYPE(ASN1_TYPE **a, const unsigned char **in, long len)
@ -344,3 +355,4 @@ d2i_ASN1_TYPE(ASN1_TYPE **a, const unsigned char **in, long len)
return (ASN1_TYPE *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_TYPE *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ASN1_ANY_it); &ASN1_ANY_it);
} }
LCRYPTO_ALIAS(d2i_ASN1_TYPE);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: ameth_lib.c,v 1.30 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: ameth_lib.c,v 1.31 2023/07/05 21:23:36 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006. * project 2006.
*/ */
@ -120,6 +120,7 @@ EVP_PKEY_asn1_get_count(void)
return num; return num;
} }
LCRYPTO_ALIAS(EVP_PKEY_asn1_get_count);
const EVP_PKEY_ASN1_METHOD * const EVP_PKEY_ASN1_METHOD *
EVP_PKEY_asn1_get0(int idx) EVP_PKEY_asn1_get0(int idx)
@ -135,6 +136,7 @@ EVP_PKEY_asn1_get0(int idx)
return sk_EVP_PKEY_ASN1_METHOD_value(asn1_app_methods, idx); return sk_EVP_PKEY_ASN1_METHOD_value(asn1_app_methods, idx);
} }
LCRYPTO_ALIAS(EVP_PKEY_asn1_get0);
static const EVP_PKEY_ASN1_METHOD * static const EVP_PKEY_ASN1_METHOD *
pkey_asn1_find(int pkey_id) pkey_asn1_find(int pkey_id)
@ -183,6 +185,7 @@ EVP_PKEY_asn1_find(ENGINE **pe, int type)
} }
return mp; return mp;
} }
LCRYPTO_ALIAS(EVP_PKEY_asn1_find);
const EVP_PKEY_ASN1_METHOD * const EVP_PKEY_ASN1_METHOD *
EVP_PKEY_asn1_find_str(ENGINE **pe, const char *str, int len) EVP_PKEY_asn1_find_str(ENGINE **pe, const char *str, int len)
@ -219,6 +222,7 @@ EVP_PKEY_asn1_find_str(ENGINE **pe, const char *str, int len)
} }
return NULL; return NULL;
} }
LCRYPTO_ALIAS(EVP_PKEY_asn1_find_str);
int int
EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth) EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth)
@ -234,6 +238,7 @@ EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth)
return 1; return 1;
} }
LCRYPTO_ALIAS(EVP_PKEY_asn1_add0);
int int
EVP_PKEY_asn1_add_alias(int to, int from) EVP_PKEY_asn1_add_alias(int to, int from)
@ -251,6 +256,7 @@ EVP_PKEY_asn1_add_alias(int to, int from)
} }
return 1; return 1;
} }
LCRYPTO_ALIAS(EVP_PKEY_asn1_add_alias);
int int
EVP_PKEY_asn1_get0_info(int *ppkey_id, int *ppkey_base_id, int *ppkey_flags, EVP_PKEY_asn1_get0_info(int *ppkey_id, int *ppkey_base_id, int *ppkey_flags,
@ -271,12 +277,14 @@ EVP_PKEY_asn1_get0_info(int *ppkey_id, int *ppkey_base_id, int *ppkey_flags,
*ppem_str = ameth->pem_str; *ppem_str = ameth->pem_str;
return 1; return 1;
} }
LCRYPTO_ALIAS(EVP_PKEY_asn1_get0_info);
const EVP_PKEY_ASN1_METHOD* const EVP_PKEY_ASN1_METHOD*
EVP_PKEY_get0_asn1(const EVP_PKEY *pkey) EVP_PKEY_get0_asn1(const EVP_PKEY *pkey)
{ {
return pkey->ameth; return pkey->ameth;
} }
LCRYPTO_ALIAS(EVP_PKEY_get0_asn1);
EVP_PKEY_ASN1_METHOD* EVP_PKEY_ASN1_METHOD*
EVP_PKEY_asn1_new(int id, int flags, const char *pem_str, const char *info) EVP_PKEY_asn1_new(int id, int flags, const char *pem_str, const char *info)
@ -306,6 +314,7 @@ EVP_PKEY_asn1_new(int id, int flags, const char *pem_str, const char *info)
EVP_PKEY_asn1_free(ameth); EVP_PKEY_asn1_free(ameth);
return NULL; return NULL;
} }
LCRYPTO_ALIAS(EVP_PKEY_asn1_new);
void void
EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst, const EVP_PKEY_ASN1_METHOD *src) EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst, const EVP_PKEY_ASN1_METHOD *src)
@ -326,6 +335,7 @@ EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst, const EVP_PKEY_ASN1_METHOD *src)
dst->pem_str = preserve.pem_str; dst->pem_str = preserve.pem_str;
dst->info = preserve.info; dst->info = preserve.info;
} }
LCRYPTO_ALIAS(EVP_PKEY_asn1_copy);
void void
EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth) EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth)
@ -336,6 +346,7 @@ EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth)
free(ameth); free(ameth);
} }
} }
LCRYPTO_ALIAS(EVP_PKEY_asn1_free);
void void
EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth, EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth,
@ -354,6 +365,7 @@ EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth,
ameth->pkey_size = pkey_size; ameth->pkey_size = pkey_size;
ameth->pkey_bits = pkey_bits; ameth->pkey_bits = pkey_bits;
} }
LCRYPTO_ALIAS(EVP_PKEY_asn1_set_public);
void void
EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth, EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth,
@ -366,6 +378,7 @@ EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth,
ameth->priv_encode = priv_encode; ameth->priv_encode = priv_encode;
ameth->priv_print = priv_print; ameth->priv_print = priv_print;
} }
LCRYPTO_ALIAS(EVP_PKEY_asn1_set_private);
void void
EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth, EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth,
@ -384,6 +397,7 @@ EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth,
ameth->param_cmp = param_cmp; ameth->param_cmp = param_cmp;
ameth->param_print = param_print; ameth->param_print = param_print;
} }
LCRYPTO_ALIAS(EVP_PKEY_asn1_set_param);
void void
EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth, EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth,
@ -391,6 +405,7 @@ EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth,
{ {
ameth->pkey_free = pkey_free; ameth->pkey_free = pkey_free;
} }
LCRYPTO_ALIAS(EVP_PKEY_asn1_set_free);
void void
EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth, EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth,
@ -398,6 +413,7 @@ EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth,
{ {
ameth->pkey_ctrl = pkey_ctrl; ameth->pkey_ctrl = pkey_ctrl;
} }
LCRYPTO_ALIAS(EVP_PKEY_asn1_set_ctrl);
void void
EVP_PKEY_asn1_set_security_bits(EVP_PKEY_ASN1_METHOD *ameth, EVP_PKEY_asn1_set_security_bits(EVP_PKEY_ASN1_METHOD *ameth,
@ -405,6 +421,7 @@ EVP_PKEY_asn1_set_security_bits(EVP_PKEY_ASN1_METHOD *ameth,
{ {
ameth->pkey_security_bits = pkey_security_bits; ameth->pkey_security_bits = pkey_security_bits;
} }
LCRYPTO_ALIAS(EVP_PKEY_asn1_set_security_bits);
void void
EVP_PKEY_asn1_set_check(EVP_PKEY_ASN1_METHOD *ameth, EVP_PKEY_asn1_set_check(EVP_PKEY_ASN1_METHOD *ameth,
@ -412,6 +429,7 @@ EVP_PKEY_asn1_set_check(EVP_PKEY_ASN1_METHOD *ameth,
{ {
ameth->pkey_check = pkey_check; ameth->pkey_check = pkey_check;
} }
LCRYPTO_ALIAS(EVP_PKEY_asn1_set_check);
void void
EVP_PKEY_asn1_set_public_check(EVP_PKEY_ASN1_METHOD *ameth, EVP_PKEY_asn1_set_public_check(EVP_PKEY_ASN1_METHOD *ameth,
@ -419,6 +437,7 @@ EVP_PKEY_asn1_set_public_check(EVP_PKEY_ASN1_METHOD *ameth,
{ {
ameth->pkey_public_check = pkey_public_check; ameth->pkey_public_check = pkey_public_check;
} }
LCRYPTO_ALIAS(EVP_PKEY_asn1_set_public_check);
void void
EVP_PKEY_asn1_set_param_check(EVP_PKEY_ASN1_METHOD *ameth, EVP_PKEY_asn1_set_param_check(EVP_PKEY_ASN1_METHOD *ameth,
@ -426,3 +445,4 @@ EVP_PKEY_asn1_set_param_check(EVP_PKEY_ASN1_METHOD *ameth,
{ {
ameth->pkey_param_check = pkey_param_check; ameth->pkey_param_check = pkey_param_check;
} }
LCRYPTO_ALIAS(EVP_PKEY_asn1_set_param_check);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: asn1_err.c,v 1.25 2022/08/29 06:48:58 jsing Exp $ */ /* $OpenBSD: asn1_err.c,v 1.26 2023/07/05 21:23:36 beck Exp $ */
/* ==================================================================== /* ====================================================================
* Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved.
* *
@ -211,3 +211,4 @@ ERR_load_ASN1_strings(void)
} }
#endif #endif
} }
LCRYPTO_ALIAS(ERR_load_ASN1_strings);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: asn1_gen.c,v 1.20 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: asn1_gen.c,v 1.21 2023/07/05 21:23:36 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2002. * project 2002.
*/ */
@ -133,6 +133,7 @@ ASN1_generate_nconf(const char *str, CONF *nconf)
X509V3_set_nconf(&cnf, nconf); X509V3_set_nconf(&cnf, nconf);
return ASN1_generate_v3(str, &cnf); return ASN1_generate_v3(str, &cnf);
} }
LCRYPTO_ALIAS(ASN1_generate_nconf);
ASN1_TYPE * ASN1_TYPE *
ASN1_generate_v3(const char *str, X509V3_CTX *cnf) ASN1_generate_v3(const char *str, X509V3_CTX *cnf)
@ -266,6 +267,7 @@ ASN1_generate_v3(const char *str, X509V3_CTX *cnf)
return ret; return ret;
} }
LCRYPTO_ALIAS(ASN1_generate_v3);
static int static int
asn1_cb(const char *elem, int len, void *bitstr) asn1_cb(const char *elem, int len, void *bitstr)

View file

@ -1,4 +1,4 @@
/* $OpenBSD: asn1_item.c,v 1.14 2023/06/15 13:58:56 tb Exp $ */ /* $OpenBSD: asn1_item.c,v 1.15 2023/07/05 21:23:36 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -138,6 +138,7 @@ ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn,
free(str); free(str);
return (1); return (1);
} }
LCRYPTO_ALIAS(ASN1_item_digest);
/* /*
* ASN1_ITEM version of ASN1_dup(): follows the same model except there's no * ASN1_ITEM version of ASN1_dup(): follows the same model except there's no
@ -166,6 +167,7 @@ ASN1_item_dup(const ASN1_ITEM *it, void *x)
free(b); free(b);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(ASN1_item_dup);
/* Pack an ASN1 object into an ASN1_STRING. */ /* Pack an ASN1 object into an ASN1_STRING. */
ASN1_STRING * ASN1_STRING *
@ -200,6 +202,7 @@ ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_STRING **oct)
ASN1_STRING_free(octmp); ASN1_STRING_free(octmp);
return NULL; return NULL;
} }
LCRYPTO_ALIAS(ASN1_item_pack);
/* Extract an ASN1 object from an ASN1_STRING. */ /* Extract an ASN1 object from an ASN1_STRING. */
void * void *
@ -213,6 +216,7 @@ ASN1_item_unpack(const ASN1_STRING *oct, const ASN1_ITEM *it)
ASN1error(ASN1_R_DECODE_ERROR); ASN1error(ASN1_R_DECODE_ERROR);
return ret; return ret;
} }
LCRYPTO_ALIAS(ASN1_item_unpack);
int int
ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
@ -226,6 +230,7 @@ ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
} }
return ASN1_item_sign_ctx(it, algor1, algor2, signature, asn, &ctx); return ASN1_item_sign_ctx(it, algor1, algor2, signature, asn, &ctx);
} }
LCRYPTO_ALIAS(ASN1_item_sign);
int int
ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
@ -335,6 +340,7 @@ ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
return ret; return ret;
} }
LCRYPTO_ALIAS(ASN1_item_sign_ctx);
int int
ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a,
@ -420,6 +426,7 @@ ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a,
return ret; return ret;
} }
LCRYPTO_ALIAS(ASN1_item_verify);
#define HEADER_SIZE 8 #define HEADER_SIZE 8
#define ASN1_CHUNK_INITIAL_SIZE (16 * 1024) #define ASN1_CHUNK_INITIAL_SIZE (16 * 1024)
@ -586,6 +593,7 @@ ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x)
BUF_MEM_free(b); BUF_MEM_free(b);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(ASN1_item_d2i_bio);
void * void *
ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x) ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x)
@ -602,6 +610,7 @@ ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x)
BIO_free(b); BIO_free(b);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(ASN1_item_d2i_fp);
int int
ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x) ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x)
@ -629,6 +638,7 @@ ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x)
free(b); free(b);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(ASN1_item_i2d_bio);
int int
ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x) ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x)
@ -645,3 +655,4 @@ ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x)
BIO_free(b); BIO_free(b);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(ASN1_item_i2d_fp);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: asn1_old.c,v 1.3 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: asn1_old.c,v 1.4 2023/07/05 21:23:36 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -91,6 +91,7 @@ ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x)
free(b); free(b);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(ASN1_dup);
void * void *
ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x) ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x)
@ -107,6 +108,7 @@ ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x)
BIO_free(b); BIO_free(b);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(ASN1_d2i_fp);
void * void *
ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x) ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x)
@ -128,6 +130,7 @@ ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x)
BUF_MEM_free(b); BUF_MEM_free(b);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(ASN1_d2i_bio);
int int
ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, void *x) ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, void *x)
@ -144,6 +147,7 @@ ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, void *x)
BIO_free(b); BIO_free(b);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(ASN1_i2d_fp);
int int
ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, unsigned char *x) ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, unsigned char *x)
@ -176,5 +180,6 @@ ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, unsigned char *x)
free(b); free(b);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(ASN1_i2d_bio);
#endif #endif

View file

@ -1,4 +1,4 @@
/* $OpenBSD: asn1_old_lib.c,v 1.5 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: asn1_old_lib.c,v 1.6 2023/07/05 21:23:36 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -118,6 +118,7 @@ ASN1_get_object(const unsigned char **pp, long *plength, int *ptag,
return ret; return ret;
} }
LCRYPTO_ALIAS(ASN1_get_object);
/* class 0 is constructed /* class 0 is constructed
* constructed == 2 for indefinite length constructed */ * constructed == 2 for indefinite length constructed */
@ -151,6 +152,7 @@ ASN1_put_object(unsigned char **pp, int constructed, int length, int tag,
asn1_put_length(&p, length); asn1_put_length(&p, length);
*pp = p; *pp = p;
} }
LCRYPTO_ALIAS(ASN1_put_object);
int int
ASN1_put_eoc(unsigned char **pp) ASN1_put_eoc(unsigned char **pp)
@ -162,6 +164,7 @@ ASN1_put_eoc(unsigned char **pp)
*pp = p; *pp = p;
return 2; return 2;
} }
LCRYPTO_ALIAS(ASN1_put_eoc);
static void static void
asn1_put_length(unsigned char **pp, int length) asn1_put_length(unsigned char **pp, int length)
@ -210,3 +213,4 @@ ASN1_object_size(int constructed, int length, int tag)
} }
return (ret); return (ret);
} }
LCRYPTO_ALIAS(ASN1_object_size);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: asn1_par.c,v 1.34 2022/02/12 03:07:24 jsing Exp $ */ /* $OpenBSD: asn1_par.c,v 1.35 2023/07/05 21:23:36 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -107,12 +107,14 @@ ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent)
{ {
return (asn1_parse2(bp, &pp, len, 0, 0, indent, 0)); return (asn1_parse2(bp, &pp, len, 0, 0, indent, 0));
} }
LCRYPTO_ALIAS(ASN1_parse);
int int
ASN1_parse_dump(BIO *bp, const unsigned char *pp, long len, int indent, int dump) ASN1_parse_dump(BIO *bp, const unsigned char *pp, long len, int indent, int dump)
{ {
return (asn1_parse2(bp, &pp, len, 0, 0, indent, dump)); return (asn1_parse2(bp, &pp, len, 0, 0, indent, dump));
} }
LCRYPTO_ALIAS(ASN1_parse_dump);
static int static int
asn1_parse2(BIO *bp, const unsigned char **pp, long length, int offset, asn1_parse2(BIO *bp, const unsigned char **pp, long length, int offset,

View file

@ -1,4 +1,4 @@
/* $OpenBSD: asn1_types.c,v 1.2 2022/09/03 18:52:18 jsing Exp $ */ /* $OpenBSD: asn1_types.c,v 1.3 2023/07/05 21:23:36 beck Exp $ */
/* /*
* Copyright (c) 2021 Joel Sing <jsing@openbsd.org> * Copyright (c) 2021 Joel Sing <jsing@openbsd.org>
* *
@ -287,6 +287,7 @@ ASN1_tag2bit(int tag)
return 0; return 0;
} }
LCRYPTO_ALIAS(ASN1_tag2bit);
const char * const char *
ASN1_tag2str(int tag) ASN1_tag2str(int tag)
@ -301,3 +302,4 @@ ASN1_tag2str(int tag)
return "(unknown)"; return "(unknown)";
} }
LCRYPTO_ALIAS(ASN1_tag2str);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: asn_mime.c,v 1.31 2023/04/19 16:36:34 tb Exp $ */ /* $OpenBSD: asn_mime.c,v 1.32 2023/07/05 21:23:36 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project. * project.
*/ */
@ -565,6 +565,7 @@ SMIME_crlf_copy(BIO *in, BIO *out, int flags)
BIO_free(bf); BIO_free(bf);
return 1; return 1;
} }
LCRYPTO_ALIAS(SMIME_crlf_copy);
/* Strip off headers if they are text/plain */ /* Strip off headers if they are text/plain */
int int
@ -597,6 +598,7 @@ SMIME_text(BIO *in, BIO *out)
return 0; return 0;
return 1; return 1;
} }
LCRYPTO_ALIAS(SMIME_text);
/* /*
* Split a multipart/XXX message body into component parts: result is * Split a multipart/XXX message body into component parts: result is

View file

@ -1,4 +1,4 @@
/* $OpenBSD: asn_moid.c,v 1.15 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: asn_moid.c,v 1.16 2023/07/05 21:23:36 beck Exp $ */
/* Written by Stephen Henson (steve@openssl.org) for the OpenSSL /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL
* project 2001. * project 2001.
*/ */
@ -105,6 +105,7 @@ ASN1_add_oid_module(void)
{ {
CONF_module_add("oid_section", oid_module_init, oid_module_finish); CONF_module_add("oid_section", oid_module_init, oid_module_finish);
} }
LCRYPTO_ALIAS(ASN1_add_oid_module);
/* Create an OID based on a name value pair. Accept two formats. /* Create an OID based on a name value pair. Accept two formats.
* shortname = 1.2.3.4 * shortname = 1.2.3.4

View file

@ -1,4 +1,4 @@
/* $OpenBSD: bio_asn1.c,v 1.21 2023/03/25 10:45:20 tb Exp $ */ /* $OpenBSD: bio_asn1.c,v 1.22 2023/07/05 21:23:36 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project. * project.
*/ */
@ -144,6 +144,7 @@ BIO_f_asn1(void)
{ {
return (&methods_asn1); return (&methods_asn1);
} }
LCRYPTO_ALIAS(BIO_f_asn1);
static int static int
asn1_bio_new(BIO *b) asn1_bio_new(BIO *b)
@ -470,21 +471,25 @@ BIO_asn1_set_prefix(BIO *b, asn1_ps_func *prefix, asn1_ps_func *prefix_free)
{ {
return asn1_bio_set_ex(b, BIO_C_SET_PREFIX, prefix, prefix_free); return asn1_bio_set_ex(b, BIO_C_SET_PREFIX, prefix, prefix_free);
} }
LCRYPTO_ALIAS(BIO_asn1_set_prefix);
int int
BIO_asn1_get_prefix(BIO *b, asn1_ps_func **pprefix, asn1_ps_func **pprefix_free) BIO_asn1_get_prefix(BIO *b, asn1_ps_func **pprefix, asn1_ps_func **pprefix_free)
{ {
return asn1_bio_get_ex(b, BIO_C_GET_PREFIX, pprefix, pprefix_free); return asn1_bio_get_ex(b, BIO_C_GET_PREFIX, pprefix, pprefix_free);
} }
LCRYPTO_ALIAS(BIO_asn1_get_prefix);
int int
BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix, asn1_ps_func *suffix_free) BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix, asn1_ps_func *suffix_free)
{ {
return asn1_bio_set_ex(b, BIO_C_SET_SUFFIX, suffix, suffix_free); return asn1_bio_set_ex(b, BIO_C_SET_SUFFIX, suffix, suffix_free);
} }
LCRYPTO_ALIAS(BIO_asn1_set_suffix);
int int
BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix, asn1_ps_func **psuffix_free) BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix, asn1_ps_func **psuffix_free)
{ {
return asn1_bio_get_ex(b, BIO_C_GET_SUFFIX, psuffix, psuffix_free); return asn1_bio_get_ex(b, BIO_C_GET_SUFFIX, psuffix, psuffix_free);
} }
LCRYPTO_ALIAS(BIO_asn1_get_suffix);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: p5_pbe.c,v 1.23 2021/12/25 13:17:48 jsing Exp $ */ /* $OpenBSD: p5_pbe.c,v 1.24 2023/07/05 21:23:36 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999. * project 1999.
*/ */
@ -95,24 +95,28 @@ d2i_PBEPARAM(PBEPARAM **a, const unsigned char **in, long len)
return (PBEPARAM *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (PBEPARAM *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&PBEPARAM_it); &PBEPARAM_it);
} }
LCRYPTO_ALIAS(d2i_PBEPARAM);
int int
i2d_PBEPARAM(PBEPARAM *a, unsigned char **out) i2d_PBEPARAM(PBEPARAM *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &PBEPARAM_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &PBEPARAM_it);
} }
LCRYPTO_ALIAS(i2d_PBEPARAM);
PBEPARAM * PBEPARAM *
PBEPARAM_new(void) PBEPARAM_new(void)
{ {
return (PBEPARAM *)ASN1_item_new(&PBEPARAM_it); return (PBEPARAM *)ASN1_item_new(&PBEPARAM_it);
} }
LCRYPTO_ALIAS(PBEPARAM_new);
void void
PBEPARAM_free(PBEPARAM *a) PBEPARAM_free(PBEPARAM *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &PBEPARAM_it); ASN1_item_free((ASN1_VALUE *)a, &PBEPARAM_it);
} }
LCRYPTO_ALIAS(PBEPARAM_free);
/* Set an algorithm identifier for a PKCS#5 PBE algorithm */ /* Set an algorithm identifier for a PKCS#5 PBE algorithm */
@ -165,6 +169,7 @@ PKCS5_pbe_set0_algor(X509_ALGOR *algor, int alg, int iter,
ASN1_STRING_free(pbe_str); ASN1_STRING_free(pbe_str);
return 0; return 0;
} }
LCRYPTO_ALIAS(PKCS5_pbe_set0_algor);
/* Return an algorithm identifier for a PKCS#5 PBE algorithm */ /* Return an algorithm identifier for a PKCS#5 PBE algorithm */
@ -184,3 +189,4 @@ PKCS5_pbe_set(int alg, int iter, const unsigned char *salt, int saltlen)
X509_ALGOR_free(ret); X509_ALGOR_free(ret);
return NULL; return NULL;
} }
LCRYPTO_ALIAS(PKCS5_pbe_set);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: p5_pbev2.c,v 1.28 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: p5_pbev2.c,v 1.29 2023/07/05 21:23:36 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999-2004. * project 1999-2004.
*/ */
@ -97,24 +97,28 @@ d2i_PBE2PARAM(PBE2PARAM **a, const unsigned char **in, long len)
return (PBE2PARAM *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (PBE2PARAM *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&PBE2PARAM_it); &PBE2PARAM_it);
} }
LCRYPTO_ALIAS(d2i_PBE2PARAM);
int int
i2d_PBE2PARAM(PBE2PARAM *a, unsigned char **out) i2d_PBE2PARAM(PBE2PARAM *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &PBE2PARAM_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &PBE2PARAM_it);
} }
LCRYPTO_ALIAS(i2d_PBE2PARAM);
PBE2PARAM * PBE2PARAM *
PBE2PARAM_new(void) PBE2PARAM_new(void)
{ {
return (PBE2PARAM *)ASN1_item_new(&PBE2PARAM_it); return (PBE2PARAM *)ASN1_item_new(&PBE2PARAM_it);
} }
LCRYPTO_ALIAS(PBE2PARAM_new);
void void
PBE2PARAM_free(PBE2PARAM *a) PBE2PARAM_free(PBE2PARAM *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &PBE2PARAM_it); ASN1_item_free((ASN1_VALUE *)a, &PBE2PARAM_it);
} }
LCRYPTO_ALIAS(PBE2PARAM_free);
static const ASN1_TEMPLATE PBKDF2PARAM_seq_tt[] = { static const ASN1_TEMPLATE PBKDF2PARAM_seq_tt[] = {
{ {
@ -157,24 +161,28 @@ d2i_PBKDF2PARAM(PBKDF2PARAM **a, const unsigned char **in, long len)
return (PBKDF2PARAM *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (PBKDF2PARAM *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&PBKDF2PARAM_it); &PBKDF2PARAM_it);
} }
LCRYPTO_ALIAS(d2i_PBKDF2PARAM);
int int
i2d_PBKDF2PARAM(PBKDF2PARAM *a, unsigned char **out) i2d_PBKDF2PARAM(PBKDF2PARAM *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &PBKDF2PARAM_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &PBKDF2PARAM_it);
} }
LCRYPTO_ALIAS(i2d_PBKDF2PARAM);
PBKDF2PARAM * PBKDF2PARAM *
PBKDF2PARAM_new(void) PBKDF2PARAM_new(void)
{ {
return (PBKDF2PARAM *)ASN1_item_new(&PBKDF2PARAM_it); return (PBKDF2PARAM *)ASN1_item_new(&PBKDF2PARAM_it);
} }
LCRYPTO_ALIAS(PBKDF2PARAM_new);
void void
PBKDF2PARAM_free(PBKDF2PARAM *a) PBKDF2PARAM_free(PBKDF2PARAM *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &PBKDF2PARAM_it); ASN1_item_free((ASN1_VALUE *)a, &PBKDF2PARAM_it);
} }
LCRYPTO_ALIAS(PBKDF2PARAM_free);
/* Return an algorithm identifier for a PKCS#5 v2.0 PBE algorithm: /* Return an algorithm identifier for a PKCS#5 v2.0 PBE algorithm:
* yes I know this is horrible! * yes I know this is horrible!
@ -285,6 +293,7 @@ PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter, unsigned char *salt,
return NULL; return NULL;
} }
LCRYPTO_ALIAS(PKCS5_pbe2_set_iv);
X509_ALGOR * X509_ALGOR *
PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, unsigned char *salt, PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, unsigned char *salt,
@ -292,6 +301,7 @@ PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, unsigned char *salt,
{ {
return PKCS5_pbe2_set_iv(cipher, iter, salt, saltlen, NULL, -1); return PKCS5_pbe2_set_iv(cipher, iter, salt, saltlen, NULL, -1);
} }
LCRYPTO_ALIAS(PKCS5_pbe2_set);
X509_ALGOR * X509_ALGOR *
PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen, int prf_nid, PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen, int prf_nid,
@ -372,3 +382,4 @@ PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen, int prf_nid,
X509_ALGOR_free(keyfunc); X509_ALGOR_free(keyfunc);
return NULL; return NULL;
} }
LCRYPTO_ALIAS(PKCS5_pbkdf2_set);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: p8_pkey.c,v 1.21 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: p8_pkey.c,v 1.22 2023/07/05 21:23:36 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999. * project 1999.
*/ */
@ -121,24 +121,28 @@ d2i_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO **a, const unsigned char **in, long
return (PKCS8_PRIV_KEY_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (PKCS8_PRIV_KEY_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&PKCS8_PRIV_KEY_INFO_it); &PKCS8_PRIV_KEY_INFO_it);
} }
LCRYPTO_ALIAS(d2i_PKCS8_PRIV_KEY_INFO);
int int
i2d_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO *a, unsigned char **out) i2d_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &PKCS8_PRIV_KEY_INFO_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &PKCS8_PRIV_KEY_INFO_it);
} }
LCRYPTO_ALIAS(i2d_PKCS8_PRIV_KEY_INFO);
PKCS8_PRIV_KEY_INFO * PKCS8_PRIV_KEY_INFO *
PKCS8_PRIV_KEY_INFO_new(void) PKCS8_PRIV_KEY_INFO_new(void)
{ {
return (PKCS8_PRIV_KEY_INFO *)ASN1_item_new(&PKCS8_PRIV_KEY_INFO_it); return (PKCS8_PRIV_KEY_INFO *)ASN1_item_new(&PKCS8_PRIV_KEY_INFO_it);
} }
LCRYPTO_ALIAS(PKCS8_PRIV_KEY_INFO_new);
void void
PKCS8_PRIV_KEY_INFO_free(PKCS8_PRIV_KEY_INFO *a) PKCS8_PRIV_KEY_INFO_free(PKCS8_PRIV_KEY_INFO *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &PKCS8_PRIV_KEY_INFO_it); ASN1_item_free((ASN1_VALUE *)a, &PKCS8_PRIV_KEY_INFO_it);
} }
LCRYPTO_ALIAS(PKCS8_PRIV_KEY_INFO_free);
int int
PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj, int version, PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj, int version,
@ -154,6 +158,7 @@ PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj, int version,
ASN1_STRING_set0(priv->pkey, penc, penclen); ASN1_STRING_set0(priv->pkey, penc, penclen);
return 1; return 1;
} }
LCRYPTO_ALIAS(PKCS8_pkey_set0);
int int
PKCS8_pkey_get0(const ASN1_OBJECT **ppkalg, const unsigned char **pk, PKCS8_pkey_get0(const ASN1_OBJECT **ppkalg, const unsigned char **pk,
@ -169,12 +174,14 @@ PKCS8_pkey_get0(const ASN1_OBJECT **ppkalg, const unsigned char **pk,
*pa = p8->pkeyalg; *pa = p8->pkeyalg;
return 1; return 1;
} }
LCRYPTO_ALIAS(PKCS8_pkey_get0);
const STACK_OF(X509_ATTRIBUTE) * const STACK_OF(X509_ATTRIBUTE) *
PKCS8_pkey_get0_attrs(const PKCS8_PRIV_KEY_INFO *p8) PKCS8_pkey_get0_attrs(const PKCS8_PRIV_KEY_INFO *p8)
{ {
return p8->attributes; return p8->attributes;
} }
LCRYPTO_ALIAS(PKCS8_pkey_get0_attrs);
int int
PKCS8_pkey_add1_attr_by_NID(PKCS8_PRIV_KEY_INFO *p8, int nid, int type, PKCS8_pkey_add1_attr_by_NID(PKCS8_PRIV_KEY_INFO *p8, int nid, int type,
@ -185,4 +192,4 @@ PKCS8_pkey_add1_attr_by_NID(PKCS8_PRIV_KEY_INFO *p8, int nid, int type,
return 1; return 1;
return 0; return 0;
} }
LCRYPTO_ALIAS(PKCS8_pkey_add1_attr_by_NID);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: t_crl.c,v 1.21 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: t_crl.c,v 1.22 2023/07/05 21:23:36 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999. * project 1999.
*/ */
@ -83,6 +83,7 @@ X509_CRL_print_fp(FILE *fp, X509_CRL *x)
BIO_free(b); BIO_free(b);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(X509_CRL_print_fp);
int int
X509_CRL_print(BIO *out, X509_CRL *x) X509_CRL_print(BIO *out, X509_CRL *x)
@ -143,3 +144,4 @@ X509_CRL_print(BIO *out, X509_CRL *x)
err: err:
return 0; return 0;
} }
LCRYPTO_ALIAS(X509_CRL_print);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: t_pkey.c,v 1.19 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: t_pkey.c,v 1.20 2023/07/05 21:23:36 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -114,6 +114,7 @@ ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num,
} }
return (1); return (1);
} }
LCRYPTO_ALIAS(ASN1_bn_print);
#define ASN1_BUF_PRINT_WIDTH 15 #define ASN1_BUF_PRINT_WIDTH 15
#define ASN1_BUF_PRINT_MAX_INDENT 64 #define ASN1_BUF_PRINT_MAX_INDENT 64
@ -143,3 +144,4 @@ ASN1_buf_print(BIO *bp, const unsigned char *buf, size_t buflen, int indent)
return 1; return 1;
} }
LCRYPTO_ALIAS(ASN1_buf_print);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: t_req.c,v 1.24 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: t_req.c,v 1.25 2023/07/05 21:23:36 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -91,6 +91,7 @@ X509_REQ_print_fp(FILE *fp, X509_REQ *x)
BIO_free(b); BIO_free(b);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(X509_REQ_print_fp);
int int
X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags, X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags,
@ -254,9 +255,11 @@ X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags,
X509error(ERR_R_BUF_LIB); X509error(ERR_R_BUF_LIB);
return (0); return (0);
} }
LCRYPTO_ALIAS(X509_REQ_print_ex);
int int
X509_REQ_print(BIO *bp, X509_REQ *x) X509_REQ_print(BIO *bp, X509_REQ *x)
{ {
return X509_REQ_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT); return X509_REQ_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT);
} }
LCRYPTO_ALIAS(X509_REQ_print);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: t_spki.c,v 1.14 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: t_spki.c,v 1.15 2023/07/05 21:23:36 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999. * project 1999.
*/ */
@ -113,3 +113,4 @@ NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki)
BIO_write(out, "\n", 1); BIO_write(out, "\n", 1);
return 1; return 1;
} }
LCRYPTO_ALIAS(NETSCAPE_SPKI_print);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: t_x509.c,v 1.41 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: t_x509.c,v 1.42 2023/07/05 21:23:36 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -85,6 +85,7 @@ X509_print_fp(FILE *fp, X509 *x)
{ {
return X509_print_ex_fp(fp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT); return X509_print_ex_fp(fp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT);
} }
LCRYPTO_ALIAS(X509_print_fp);
int int
X509_print_ex_fp(FILE *fp, X509 *x, unsigned long nmflag, unsigned long cflag) X509_print_ex_fp(FILE *fp, X509 *x, unsigned long nmflag, unsigned long cflag)
@ -101,12 +102,14 @@ X509_print_ex_fp(FILE *fp, X509 *x, unsigned long nmflag, unsigned long cflag)
BIO_free(b); BIO_free(b);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(X509_print_ex_fp);
int int
X509_print(BIO *bp, X509 *x) X509_print(BIO *bp, X509 *x)
{ {
return X509_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT); return X509_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT);
} }
LCRYPTO_ALIAS(X509_print);
int int
X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag) X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag)
@ -250,6 +253,7 @@ X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag)
free(m); free(m);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(X509_print_ex);
int int
X509_ocspid_print(BIO *bp, X509 *x) X509_ocspid_print(BIO *bp, X509 *x)
@ -301,6 +305,7 @@ X509_ocspid_print(BIO *bp, X509 *x)
free(der); free(der);
return (0); return (0);
} }
LCRYPTO_ALIAS(X509_ocspid_print);
int int
X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent) X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent)
@ -326,6 +331,7 @@ X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent)
return 1; return 1;
} }
LCRYPTO_ALIAS(X509_signature_dump);
int int
X509_signature_print(BIO *bp, const X509_ALGOR *sigalg, const ASN1_STRING *sig) X509_signature_print(BIO *bp, const X509_ALGOR *sigalg, const ASN1_STRING *sig)
@ -352,6 +358,7 @@ X509_signature_print(BIO *bp, const X509_ALGOR *sigalg, const ASN1_STRING *sig)
return 0; return 0;
return 1; return 1;
} }
LCRYPTO_ALIAS(X509_signature_print);
int int
ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm)
@ -363,6 +370,7 @@ ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm)
BIO_write(bp, "Bad time value", 14); BIO_write(bp, "Bad time value", 14);
return (0); return (0);
} }
LCRYPTO_ALIAS(ASN1_TIME_print);
static const char *mon[12] = { static const char *mon[12] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jan", "Feb", "Mar", "Apr", "May", "Jun",
@ -422,6 +430,7 @@ ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)
BIO_write(bp, "Bad time value", 14); BIO_write(bp, "Bad time value", 14);
return (0); return (0);
} }
LCRYPTO_ALIAS(ASN1_GENERALIZEDTIME_print);
int int
ASN1_UTCTIME_print(BIO *bp, const ASN1_UTCTIME *tm) ASN1_UTCTIME_print(BIO *bp, const ASN1_UTCTIME *tm)
@ -465,6 +474,7 @@ ASN1_UTCTIME_print(BIO *bp, const ASN1_UTCTIME *tm)
BIO_write(bp, "Bad time value", 14); BIO_write(bp, "Bad time value", 14);
return (0); return (0);
} }
LCRYPTO_ALIAS(ASN1_UTCTIME_print);
int int
X509_NAME_print(BIO *bp, const X509_NAME *name, int obase) X509_NAME_print(BIO *bp, const X509_NAME *name, int obase)
@ -510,3 +520,4 @@ X509_NAME_print(BIO *bp, const X509_NAME *name, int obase)
free(b); free(b);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(X509_NAME_print);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: t_x509a.c,v 1.11 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: t_x509a.c,v 1.12 2023/07/05 21:23:36 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999. * project 1999.
*/ */
@ -117,3 +117,4 @@ X509_CERT_AUX_print(BIO *out, X509_CERT_AUX *aux, int indent)
} }
return 1; return 1;
} }
LCRYPTO_ALIAS(X509_CERT_AUX_print);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: tasn_dec.c,v 1.86 2023/04/30 16:46:49 job Exp $ */ /* $OpenBSD: tasn_dec.c,v 1.87 2023/07/05 21:23:36 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000. * project 2000.
*/ */
@ -1237,6 +1237,7 @@ ASN1_item_d2i(ASN1_VALUE **pval, const unsigned char **in, long inlen,
return *pval; return *pval;
} }
LCRYPTO_ALIAS(ASN1_item_d2i);
int int
ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long inlen, ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long inlen,
@ -1256,6 +1257,7 @@ ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long inlen,
return ret; return ret;
} }
LCRYPTO_ALIAS(ASN1_item_ex_d2i);
int int
ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
@ -1273,3 +1275,4 @@ ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
return ret; return ret;
} }
LCRYPTO_ALIAS(ASN1_template_d2i);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: tasn_enc.c,v 1.31 2023/04/30 16:46:49 job Exp $ */ /* $OpenBSD: tasn_enc.c,v 1.32 2023/07/05 21:23:36 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000. * project 2000.
*/ */
@ -92,6 +92,7 @@ ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it)
{ {
return asn1_item_flags_i2d(val, out, it, 0); return asn1_item_flags_i2d(val, out, it, 0);
} }
LCRYPTO_ALIAS(ASN1_item_i2d);
/* Encode an ASN1 item, this is use by the /* Encode an ASN1 item, this is use by the
* standard 'i2d' function. 'out' points to * standard 'i2d' function. 'out' points to
@ -268,6 +269,7 @@ ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it,
} }
return 0; return 0;
} }
LCRYPTO_ALIAS(ASN1_item_ex_i2d);
int int
ASN1_template_i2d(ASN1_VALUE **pval, unsigned char **out, ASN1_template_i2d(ASN1_VALUE **pval, unsigned char **out,
@ -275,6 +277,7 @@ ASN1_template_i2d(ASN1_VALUE **pval, unsigned char **out,
{ {
return asn1_template_ex_i2d(pval, out, tt, -1, 0); return asn1_template_ex_i2d(pval, out, tt, -1, 0);
} }
LCRYPTO_ALIAS(ASN1_template_i2d);
static int static int
asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out, asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out,

View file

@ -1,4 +1,4 @@
/* $OpenBSD: tasn_fre.c,v 1.21 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: tasn_fre.c,v 1.22 2023/07/05 21:23:36 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000. * project 2000.
*/ */
@ -73,12 +73,14 @@ ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it)
{ {
asn1_item_free(&val, it); asn1_item_free(&val, it);
} }
LCRYPTO_ALIAS(ASN1_item_free);
void void
ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it) ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it)
{ {
asn1_item_free(pval, it); asn1_item_free(pval, it);
} }
LCRYPTO_ALIAS(ASN1_item_ex_free);
static void static void
asn1_item_free(ASN1_VALUE **pval, const ASN1_ITEM *it) asn1_item_free(ASN1_VALUE **pval, const ASN1_ITEM *it)
@ -183,6 +185,7 @@ ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt)
} else } else
asn1_item_free(pval, tt->item); asn1_item_free(pval, tt->item);
} }
LCRYPTO_ALIAS(ASN1_template_free);
void void
ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it) ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it)
@ -239,3 +242,4 @@ ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it)
} }
*pval = NULL; *pval = NULL;
} }
LCRYPTO_ALIAS(ASN1_primitive_free);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: tasn_new.c,v 1.23 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: tasn_new.c,v 1.24 2023/07/05 21:23:36 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000. * project 2000.
*/ */
@ -79,6 +79,7 @@ ASN1_item_new(const ASN1_ITEM *it)
return ret; return ret;
return NULL; return NULL;
} }
LCRYPTO_ALIAS(ASN1_item_new);
/* Allocate an ASN1 structure */ /* Allocate an ASN1 structure */
@ -87,6 +88,7 @@ ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
{ {
return asn1_item_ex_new(pval, it); return asn1_item_ex_new(pval, it);
} }
LCRYPTO_ALIAS(ASN1_item_ex_new);
static int static int
asn1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it) asn1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
@ -246,6 +248,7 @@ ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt)
done: done:
return ret; return ret;
} }
LCRYPTO_ALIAS(ASN1_template_new);
static void static void
asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt)
@ -315,6 +318,7 @@ ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
return 1; return 1;
return 0; return 0;
} }
LCRYPTO_ALIAS(ASN1_primitive_new);
static void static void
asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it) asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it)

View file

@ -1,4 +1,4 @@
/* $OpenBSD: tasn_prn.c,v 1.24 2023/04/17 08:43:16 tb Exp $ */ /* $OpenBSD: tasn_prn.c,v 1.25 2023/07/05 21:23:36 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000. * project 2000.
*/ */
@ -88,72 +88,84 @@ ASN1_PCTX_new(void)
return p; return p;
} }
LCRYPTO_ALIAS(ASN1_PCTX_new);
void void
ASN1_PCTX_free(ASN1_PCTX *p) ASN1_PCTX_free(ASN1_PCTX *p)
{ {
free(p); free(p);
} }
LCRYPTO_ALIAS(ASN1_PCTX_free);
unsigned long unsigned long
ASN1_PCTX_get_flags(const ASN1_PCTX *p) ASN1_PCTX_get_flags(const ASN1_PCTX *p)
{ {
return p->flags; return p->flags;
} }
LCRYPTO_ALIAS(ASN1_PCTX_get_flags);
void void
ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags) ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags)
{ {
p->flags = flags; p->flags = flags;
} }
LCRYPTO_ALIAS(ASN1_PCTX_set_flags);
unsigned long unsigned long
ASN1_PCTX_get_nm_flags(const ASN1_PCTX *p) ASN1_PCTX_get_nm_flags(const ASN1_PCTX *p)
{ {
return p->nm_flags; return p->nm_flags;
} }
LCRYPTO_ALIAS(ASN1_PCTX_get_nm_flags);
void void
ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags) ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags)
{ {
p->nm_flags = flags; p->nm_flags = flags;
} }
LCRYPTO_ALIAS(ASN1_PCTX_set_nm_flags);
unsigned long unsigned long
ASN1_PCTX_get_cert_flags(const ASN1_PCTX *p) ASN1_PCTX_get_cert_flags(const ASN1_PCTX *p)
{ {
return p->cert_flags; return p->cert_flags;
} }
LCRYPTO_ALIAS(ASN1_PCTX_get_cert_flags);
void void
ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags) ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags)
{ {
p->cert_flags = flags; p->cert_flags = flags;
} }
LCRYPTO_ALIAS(ASN1_PCTX_set_cert_flags);
unsigned long unsigned long
ASN1_PCTX_get_oid_flags(const ASN1_PCTX *p) ASN1_PCTX_get_oid_flags(const ASN1_PCTX *p)
{ {
return p->oid_flags; return p->oid_flags;
} }
LCRYPTO_ALIAS(ASN1_PCTX_get_oid_flags);
void void
ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags) ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags)
{ {
p->oid_flags = flags; p->oid_flags = flags;
} }
LCRYPTO_ALIAS(ASN1_PCTX_set_oid_flags);
unsigned long unsigned long
ASN1_PCTX_get_str_flags(const ASN1_PCTX *p) ASN1_PCTX_get_str_flags(const ASN1_PCTX *p)
{ {
return p->str_flags; return p->str_flags;
} }
LCRYPTO_ALIAS(ASN1_PCTX_get_str_flags);
void void
ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags) ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags)
{ {
p->str_flags = flags; p->str_flags = flags;
} }
LCRYPTO_ALIAS(ASN1_PCTX_set_str_flags);
/* Main print routines */ /* Main print routines */
@ -186,6 +198,7 @@ ASN1_item_print(BIO *out, ASN1_VALUE *ifld, int indent, const ASN1_ITEM *it,
return asn1_item_print_ctx(out, &ifld, indent, it, NULL, sname, return asn1_item_print_ctx(out, &ifld, indent, it, NULL, sname,
0, pctx); 0, pctx);
} }
LCRYPTO_ALIAS(ASN1_item_print);
static int static int
asn1_item_print_ctx(BIO *out, ASN1_VALUE **fld, int indent, const ASN1_ITEM *it, asn1_item_print_ctx(BIO *out, ASN1_VALUE **fld, int indent, const ASN1_ITEM *it,

View file

@ -1,4 +1,4 @@
/* $OpenBSD: tasn_typ.c,v 1.17 2021/12/26 15:20:21 tb Exp $ */ /* $OpenBSD: tasn_typ.c,v 1.18 2023/07/05 21:23:37 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000. * project 2000.
*/ */
@ -73,24 +73,28 @@ d2i_ASN1_NULL(ASN1_NULL **a, const unsigned char **in, long len)
return (ASN1_NULL *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_NULL *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ASN1_NULL_it); &ASN1_NULL_it);
} }
LCRYPTO_ALIAS(d2i_ASN1_NULL);
int int
i2d_ASN1_NULL(ASN1_NULL *a, unsigned char **out) i2d_ASN1_NULL(ASN1_NULL *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_NULL_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_NULL_it);
} }
LCRYPTO_ALIAS(i2d_ASN1_NULL);
ASN1_NULL * ASN1_NULL *
ASN1_NULL_new(void) ASN1_NULL_new(void)
{ {
return (ASN1_NULL *)ASN1_item_new(&ASN1_NULL_it); return (ASN1_NULL *)ASN1_item_new(&ASN1_NULL_it);
} }
LCRYPTO_ALIAS(ASN1_NULL_new);
void void
ASN1_NULL_free(ASN1_NULL *a) ASN1_NULL_free(ASN1_NULL *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &ASN1_NULL_it); ASN1_item_free((ASN1_VALUE *)a, &ASN1_NULL_it);
} }
LCRYPTO_ALIAS(ASN1_NULL_free);
const ASN1_ITEM ASN1_UTF8STRING_it = { const ASN1_ITEM ASN1_UTF8STRING_it = {
@ -105,24 +109,28 @@ d2i_ASN1_UTF8STRING(ASN1_UTF8STRING **a, const unsigned char **in, long len)
return (ASN1_UTF8STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_UTF8STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ASN1_UTF8STRING_it); &ASN1_UTF8STRING_it);
} }
LCRYPTO_ALIAS(d2i_ASN1_UTF8STRING);
int int
i2d_ASN1_UTF8STRING(ASN1_UTF8STRING *a, unsigned char **out) i2d_ASN1_UTF8STRING(ASN1_UTF8STRING *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_UTF8STRING_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_UTF8STRING_it);
} }
LCRYPTO_ALIAS(i2d_ASN1_UTF8STRING);
ASN1_UTF8STRING * ASN1_UTF8STRING *
ASN1_UTF8STRING_new(void) ASN1_UTF8STRING_new(void)
{ {
return (ASN1_UTF8STRING *)ASN1_item_new(&ASN1_UTF8STRING_it); return (ASN1_UTF8STRING *)ASN1_item_new(&ASN1_UTF8STRING_it);
} }
LCRYPTO_ALIAS(ASN1_UTF8STRING_new);
void void
ASN1_UTF8STRING_free(ASN1_UTF8STRING *a) ASN1_UTF8STRING_free(ASN1_UTF8STRING *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &ASN1_UTF8STRING_it); ASN1_item_free((ASN1_VALUE *)a, &ASN1_UTF8STRING_it);
} }
LCRYPTO_ALIAS(ASN1_UTF8STRING_free);
const ASN1_ITEM ASN1_PRINTABLESTRING_it = { const ASN1_ITEM ASN1_PRINTABLESTRING_it = {
@ -138,24 +146,28 @@ d2i_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING **a, const unsigned char **in,
return (ASN1_PRINTABLESTRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_PRINTABLESTRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ASN1_PRINTABLESTRING_it); &ASN1_PRINTABLESTRING_it);
} }
LCRYPTO_ALIAS(d2i_ASN1_PRINTABLESTRING);
int int
i2d_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING *a, unsigned char **out) i2d_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_PRINTABLESTRING_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_PRINTABLESTRING_it);
} }
LCRYPTO_ALIAS(i2d_ASN1_PRINTABLESTRING);
ASN1_PRINTABLESTRING * ASN1_PRINTABLESTRING *
ASN1_PRINTABLESTRING_new(void) ASN1_PRINTABLESTRING_new(void)
{ {
return (ASN1_PRINTABLESTRING *)ASN1_item_new(&ASN1_PRINTABLESTRING_it); return (ASN1_PRINTABLESTRING *)ASN1_item_new(&ASN1_PRINTABLESTRING_it);
} }
LCRYPTO_ALIAS(ASN1_PRINTABLESTRING_new);
void void
ASN1_PRINTABLESTRING_free(ASN1_PRINTABLESTRING *a) ASN1_PRINTABLESTRING_free(ASN1_PRINTABLESTRING *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &ASN1_PRINTABLESTRING_it); ASN1_item_free((ASN1_VALUE *)a, &ASN1_PRINTABLESTRING_it);
} }
LCRYPTO_ALIAS(ASN1_PRINTABLESTRING_free);
const ASN1_ITEM ASN1_T61STRING_it = { const ASN1_ITEM ASN1_T61STRING_it = {
@ -170,24 +182,28 @@ d2i_ASN1_T61STRING(ASN1_T61STRING **a, const unsigned char **in, long len)
return (ASN1_T61STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_T61STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ASN1_T61STRING_it); &ASN1_T61STRING_it);
} }
LCRYPTO_ALIAS(d2i_ASN1_T61STRING);
int int
i2d_ASN1_T61STRING(ASN1_T61STRING *a, unsigned char **out) i2d_ASN1_T61STRING(ASN1_T61STRING *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_T61STRING_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_T61STRING_it);
} }
LCRYPTO_ALIAS(i2d_ASN1_T61STRING);
ASN1_T61STRING * ASN1_T61STRING *
ASN1_T61STRING_new(void) ASN1_T61STRING_new(void)
{ {
return (ASN1_T61STRING *)ASN1_item_new(&ASN1_T61STRING_it); return (ASN1_T61STRING *)ASN1_item_new(&ASN1_T61STRING_it);
} }
LCRYPTO_ALIAS(ASN1_T61STRING_new);
void void
ASN1_T61STRING_free(ASN1_T61STRING *a) ASN1_T61STRING_free(ASN1_T61STRING *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &ASN1_T61STRING_it); ASN1_item_free((ASN1_VALUE *)a, &ASN1_T61STRING_it);
} }
LCRYPTO_ALIAS(ASN1_T61STRING_free);
const ASN1_ITEM ASN1_IA5STRING_it = { const ASN1_ITEM ASN1_IA5STRING_it = {
@ -202,24 +218,28 @@ d2i_ASN1_IA5STRING(ASN1_IA5STRING **a, const unsigned char **in, long len)
return (ASN1_IA5STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_IA5STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ASN1_IA5STRING_it); &ASN1_IA5STRING_it);
} }
LCRYPTO_ALIAS(d2i_ASN1_IA5STRING);
int int
i2d_ASN1_IA5STRING(ASN1_IA5STRING *a, unsigned char **out) i2d_ASN1_IA5STRING(ASN1_IA5STRING *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_IA5STRING_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_IA5STRING_it);
} }
LCRYPTO_ALIAS(i2d_ASN1_IA5STRING);
ASN1_IA5STRING * ASN1_IA5STRING *
ASN1_IA5STRING_new(void) ASN1_IA5STRING_new(void)
{ {
return (ASN1_IA5STRING *)ASN1_item_new(&ASN1_IA5STRING_it); return (ASN1_IA5STRING *)ASN1_item_new(&ASN1_IA5STRING_it);
} }
LCRYPTO_ALIAS(ASN1_IA5STRING_new);
void void
ASN1_IA5STRING_free(ASN1_IA5STRING *a) ASN1_IA5STRING_free(ASN1_IA5STRING *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &ASN1_IA5STRING_it); ASN1_item_free((ASN1_VALUE *)a, &ASN1_IA5STRING_it);
} }
LCRYPTO_ALIAS(ASN1_IA5STRING_free);
const ASN1_ITEM ASN1_GENERALSTRING_it = { const ASN1_ITEM ASN1_GENERALSTRING_it = {
@ -235,24 +255,28 @@ d2i_ASN1_GENERALSTRING(ASN1_GENERALSTRING **a, const unsigned char **in,
return (ASN1_GENERALSTRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_GENERALSTRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ASN1_GENERALSTRING_it); &ASN1_GENERALSTRING_it);
} }
LCRYPTO_ALIAS(d2i_ASN1_GENERALSTRING);
int int
i2d_ASN1_GENERALSTRING(ASN1_GENERALSTRING *a, unsigned char **out) i2d_ASN1_GENERALSTRING(ASN1_GENERALSTRING *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_GENERALSTRING_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_GENERALSTRING_it);
} }
LCRYPTO_ALIAS(i2d_ASN1_GENERALSTRING);
ASN1_GENERALSTRING * ASN1_GENERALSTRING *
ASN1_GENERALSTRING_new(void) ASN1_GENERALSTRING_new(void)
{ {
return (ASN1_GENERALSTRING *)ASN1_item_new(&ASN1_GENERALSTRING_it); return (ASN1_GENERALSTRING *)ASN1_item_new(&ASN1_GENERALSTRING_it);
} }
LCRYPTO_ALIAS(ASN1_GENERALSTRING_new);
void void
ASN1_GENERALSTRING_free(ASN1_GENERALSTRING *a) ASN1_GENERALSTRING_free(ASN1_GENERALSTRING *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &ASN1_GENERALSTRING_it); ASN1_item_free((ASN1_VALUE *)a, &ASN1_GENERALSTRING_it);
} }
LCRYPTO_ALIAS(ASN1_GENERALSTRING_free);
const ASN1_ITEM ASN1_UTCTIME_it = { const ASN1_ITEM ASN1_UTCTIME_it = {
@ -267,24 +291,28 @@ d2i_ASN1_UTCTIME(ASN1_UTCTIME **a, const unsigned char **in, long len)
return (ASN1_UTCTIME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_UTCTIME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ASN1_UTCTIME_it); &ASN1_UTCTIME_it);
} }
LCRYPTO_ALIAS(d2i_ASN1_UTCTIME);
int int
i2d_ASN1_UTCTIME(ASN1_UTCTIME *a, unsigned char **out) i2d_ASN1_UTCTIME(ASN1_UTCTIME *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_UTCTIME_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_UTCTIME_it);
} }
LCRYPTO_ALIAS(i2d_ASN1_UTCTIME);
ASN1_UTCTIME * ASN1_UTCTIME *
ASN1_UTCTIME_new(void) ASN1_UTCTIME_new(void)
{ {
return (ASN1_UTCTIME *)ASN1_item_new(&ASN1_UTCTIME_it); return (ASN1_UTCTIME *)ASN1_item_new(&ASN1_UTCTIME_it);
} }
LCRYPTO_ALIAS(ASN1_UTCTIME_new);
void void
ASN1_UTCTIME_free(ASN1_UTCTIME *a) ASN1_UTCTIME_free(ASN1_UTCTIME *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &ASN1_UTCTIME_it); ASN1_item_free((ASN1_VALUE *)a, &ASN1_UTCTIME_it);
} }
LCRYPTO_ALIAS(ASN1_UTCTIME_free);
const ASN1_ITEM ASN1_GENERALIZEDTIME_it = { const ASN1_ITEM ASN1_GENERALIZEDTIME_it = {
@ -300,24 +328,28 @@ d2i_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME **a, const unsigned char **in,
return (ASN1_GENERALIZEDTIME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_GENERALIZEDTIME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ASN1_GENERALIZEDTIME_it); &ASN1_GENERALIZEDTIME_it);
} }
LCRYPTO_ALIAS(d2i_ASN1_GENERALIZEDTIME);
int int
i2d_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME *a, unsigned char **out) i2d_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_GENERALIZEDTIME_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_GENERALIZEDTIME_it);
} }
LCRYPTO_ALIAS(i2d_ASN1_GENERALIZEDTIME);
ASN1_GENERALIZEDTIME * ASN1_GENERALIZEDTIME *
ASN1_GENERALIZEDTIME_new(void) ASN1_GENERALIZEDTIME_new(void)
{ {
return (ASN1_GENERALIZEDTIME *)ASN1_item_new(&ASN1_GENERALIZEDTIME_it); return (ASN1_GENERALIZEDTIME *)ASN1_item_new(&ASN1_GENERALIZEDTIME_it);
} }
LCRYPTO_ALIAS(ASN1_GENERALIZEDTIME_new);
void void
ASN1_GENERALIZEDTIME_free(ASN1_GENERALIZEDTIME *a) ASN1_GENERALIZEDTIME_free(ASN1_GENERALIZEDTIME *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &ASN1_GENERALIZEDTIME_it); ASN1_item_free((ASN1_VALUE *)a, &ASN1_GENERALIZEDTIME_it);
} }
LCRYPTO_ALIAS(ASN1_GENERALIZEDTIME_free);
const ASN1_ITEM ASN1_VISIBLESTRING_it = { const ASN1_ITEM ASN1_VISIBLESTRING_it = {
@ -333,24 +365,28 @@ d2i_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING **a, const unsigned char **in,
return (ASN1_VISIBLESTRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_VISIBLESTRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ASN1_VISIBLESTRING_it); &ASN1_VISIBLESTRING_it);
} }
LCRYPTO_ALIAS(d2i_ASN1_VISIBLESTRING);
int int
i2d_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING *a, unsigned char **out) i2d_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_VISIBLESTRING_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_VISIBLESTRING_it);
} }
LCRYPTO_ALIAS(i2d_ASN1_VISIBLESTRING);
ASN1_VISIBLESTRING * ASN1_VISIBLESTRING *
ASN1_VISIBLESTRING_new(void) ASN1_VISIBLESTRING_new(void)
{ {
return (ASN1_VISIBLESTRING *)ASN1_item_new(&ASN1_VISIBLESTRING_it); return (ASN1_VISIBLESTRING *)ASN1_item_new(&ASN1_VISIBLESTRING_it);
} }
LCRYPTO_ALIAS(ASN1_VISIBLESTRING_new);
void void
ASN1_VISIBLESTRING_free(ASN1_VISIBLESTRING *a) ASN1_VISIBLESTRING_free(ASN1_VISIBLESTRING *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &ASN1_VISIBLESTRING_it); ASN1_item_free((ASN1_VALUE *)a, &ASN1_VISIBLESTRING_it);
} }
LCRYPTO_ALIAS(ASN1_VISIBLESTRING_free);
const ASN1_ITEM ASN1_UNIVERSALSTRING_it = { const ASN1_ITEM ASN1_UNIVERSALSTRING_it = {
@ -366,24 +402,28 @@ d2i_ASN1_UNIVERSALSTRING(ASN1_UNIVERSALSTRING **a, const unsigned char **in,
return (ASN1_UNIVERSALSTRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_UNIVERSALSTRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ASN1_UNIVERSALSTRING_it); &ASN1_UNIVERSALSTRING_it);
} }
LCRYPTO_ALIAS(d2i_ASN1_UNIVERSALSTRING);
int int
i2d_ASN1_UNIVERSALSTRING(ASN1_UNIVERSALSTRING *a, unsigned char **out) i2d_ASN1_UNIVERSALSTRING(ASN1_UNIVERSALSTRING *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_UNIVERSALSTRING_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_UNIVERSALSTRING_it);
} }
LCRYPTO_ALIAS(i2d_ASN1_UNIVERSALSTRING);
ASN1_UNIVERSALSTRING * ASN1_UNIVERSALSTRING *
ASN1_UNIVERSALSTRING_new(void) ASN1_UNIVERSALSTRING_new(void)
{ {
return (ASN1_UNIVERSALSTRING *)ASN1_item_new(&ASN1_UNIVERSALSTRING_it); return (ASN1_UNIVERSALSTRING *)ASN1_item_new(&ASN1_UNIVERSALSTRING_it);
} }
LCRYPTO_ALIAS(ASN1_UNIVERSALSTRING_new);
void void
ASN1_UNIVERSALSTRING_free(ASN1_UNIVERSALSTRING *a) ASN1_UNIVERSALSTRING_free(ASN1_UNIVERSALSTRING *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &ASN1_UNIVERSALSTRING_it); ASN1_item_free((ASN1_VALUE *)a, &ASN1_UNIVERSALSTRING_it);
} }
LCRYPTO_ALIAS(ASN1_UNIVERSALSTRING_free);
const ASN1_ITEM ASN1_BMPSTRING_it = { const ASN1_ITEM ASN1_BMPSTRING_it = {
@ -398,24 +438,28 @@ d2i_ASN1_BMPSTRING(ASN1_BMPSTRING **a, const unsigned char **in, long len)
return (ASN1_BMPSTRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_BMPSTRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ASN1_BMPSTRING_it); &ASN1_BMPSTRING_it);
} }
LCRYPTO_ALIAS(d2i_ASN1_BMPSTRING);
int int
i2d_ASN1_BMPSTRING(ASN1_BMPSTRING *a, unsigned char **out) i2d_ASN1_BMPSTRING(ASN1_BMPSTRING *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_BMPSTRING_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_BMPSTRING_it);
} }
LCRYPTO_ALIAS(i2d_ASN1_BMPSTRING);
ASN1_BMPSTRING * ASN1_BMPSTRING *
ASN1_BMPSTRING_new(void) ASN1_BMPSTRING_new(void)
{ {
return (ASN1_BMPSTRING *)ASN1_item_new(&ASN1_BMPSTRING_it); return (ASN1_BMPSTRING *)ASN1_item_new(&ASN1_BMPSTRING_it);
} }
LCRYPTO_ALIAS(ASN1_BMPSTRING_new);
void void
ASN1_BMPSTRING_free(ASN1_BMPSTRING *a) ASN1_BMPSTRING_free(ASN1_BMPSTRING *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &ASN1_BMPSTRING_it); ASN1_item_free((ASN1_VALUE *)a, &ASN1_BMPSTRING_it);
} }
LCRYPTO_ALIAS(ASN1_BMPSTRING_free);
const ASN1_ITEM ASN1_ANY_it = { const ASN1_ITEM ASN1_ANY_it = {
.itype = ASN1_ITYPE_PRIMITIVE, .itype = ASN1_ITYPE_PRIMITIVE,
@ -452,24 +496,28 @@ d2i_ASN1_PRINTABLE(ASN1_STRING **a, const unsigned char **in, long len)
return (ASN1_STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ASN1_PRINTABLE_it); &ASN1_PRINTABLE_it);
} }
LCRYPTO_ALIAS(d2i_ASN1_PRINTABLE);
int int
i2d_ASN1_PRINTABLE(ASN1_STRING *a, unsigned char **out) i2d_ASN1_PRINTABLE(ASN1_STRING *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_PRINTABLE_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_PRINTABLE_it);
} }
LCRYPTO_ALIAS(i2d_ASN1_PRINTABLE);
ASN1_STRING * ASN1_STRING *
ASN1_PRINTABLE_new(void) ASN1_PRINTABLE_new(void)
{ {
return (ASN1_STRING *)ASN1_item_new(&ASN1_PRINTABLE_it); return (ASN1_STRING *)ASN1_item_new(&ASN1_PRINTABLE_it);
} }
LCRYPTO_ALIAS(ASN1_PRINTABLE_new);
void void
ASN1_PRINTABLE_free(ASN1_STRING *a) ASN1_PRINTABLE_free(ASN1_STRING *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &ASN1_PRINTABLE_it); ASN1_item_free((ASN1_VALUE *)a, &ASN1_PRINTABLE_it);
} }
LCRYPTO_ALIAS(ASN1_PRINTABLE_free);
const ASN1_ITEM DISPLAYTEXT_it = { const ASN1_ITEM DISPLAYTEXT_it = {
@ -488,24 +536,28 @@ d2i_DISPLAYTEXT(ASN1_STRING **a, const unsigned char **in, long len)
return (ASN1_STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&DISPLAYTEXT_it); &DISPLAYTEXT_it);
} }
LCRYPTO_ALIAS(d2i_DISPLAYTEXT);
int int
i2d_DISPLAYTEXT(ASN1_STRING *a, unsigned char **out) i2d_DISPLAYTEXT(ASN1_STRING *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &DISPLAYTEXT_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &DISPLAYTEXT_it);
} }
LCRYPTO_ALIAS(i2d_DISPLAYTEXT);
ASN1_STRING * ASN1_STRING *
DISPLAYTEXT_new(void) DISPLAYTEXT_new(void)
{ {
return (ASN1_STRING *)ASN1_item_new(&DISPLAYTEXT_it); return (ASN1_STRING *)ASN1_item_new(&DISPLAYTEXT_it);
} }
LCRYPTO_ALIAS(DISPLAYTEXT_new);
void void
DISPLAYTEXT_free(ASN1_STRING *a) DISPLAYTEXT_free(ASN1_STRING *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &DISPLAYTEXT_it); ASN1_item_free((ASN1_VALUE *)a, &DISPLAYTEXT_it);
} }
LCRYPTO_ALIAS(DISPLAYTEXT_free);
const ASN1_ITEM DIRECTORYSTRING_it = { const ASN1_ITEM DIRECTORYSTRING_it = {
@ -524,24 +576,28 @@ d2i_DIRECTORYSTRING(ASN1_STRING **a, const unsigned char **in, long len)
return (ASN1_STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&DIRECTORYSTRING_it); &DIRECTORYSTRING_it);
} }
LCRYPTO_ALIAS(d2i_DIRECTORYSTRING);
int int
i2d_DIRECTORYSTRING(ASN1_STRING *a, unsigned char **out) i2d_DIRECTORYSTRING(ASN1_STRING *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &DIRECTORYSTRING_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &DIRECTORYSTRING_it);
} }
LCRYPTO_ALIAS(i2d_DIRECTORYSTRING);
ASN1_STRING * ASN1_STRING *
DIRECTORYSTRING_new(void) DIRECTORYSTRING_new(void)
{ {
return (ASN1_STRING *)ASN1_item_new(&DIRECTORYSTRING_it); return (ASN1_STRING *)ASN1_item_new(&DIRECTORYSTRING_it);
} }
LCRYPTO_ALIAS(DIRECTORYSTRING_new);
void void
DIRECTORYSTRING_free(ASN1_STRING *a) DIRECTORYSTRING_free(ASN1_STRING *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &DIRECTORYSTRING_it); ASN1_item_free((ASN1_VALUE *)a, &DIRECTORYSTRING_it);
} }
LCRYPTO_ALIAS(DIRECTORYSTRING_free);
/* Three separate BOOLEAN type: normal, DEFAULT TRUE and DEFAULT FALSE */ /* Three separate BOOLEAN type: normal, DEFAULT TRUE and DEFAULT FALSE */
@ -640,12 +696,14 @@ d2i_ASN1_SEQUENCE_ANY(ASN1_SEQUENCE_ANY **a, const unsigned char **in, long len)
return (ASN1_SEQUENCE_ANY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_SEQUENCE_ANY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ASN1_SEQUENCE_ANY_it); &ASN1_SEQUENCE_ANY_it);
} }
LCRYPTO_ALIAS(d2i_ASN1_SEQUENCE_ANY);
int int
i2d_ASN1_SEQUENCE_ANY(const ASN1_SEQUENCE_ANY *a, unsigned char **out) i2d_ASN1_SEQUENCE_ANY(const ASN1_SEQUENCE_ANY *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_SEQUENCE_ANY_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_SEQUENCE_ANY_it);
} }
LCRYPTO_ALIAS(i2d_ASN1_SEQUENCE_ANY);
ASN1_SEQUENCE_ANY * ASN1_SEQUENCE_ANY *
d2i_ASN1_SET_ANY(ASN1_SEQUENCE_ANY **a, const unsigned char **in, long len) d2i_ASN1_SET_ANY(ASN1_SEQUENCE_ANY **a, const unsigned char **in, long len)
@ -653,9 +711,11 @@ d2i_ASN1_SET_ANY(ASN1_SEQUENCE_ANY **a, const unsigned char **in, long len)
return (ASN1_SEQUENCE_ANY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (ASN1_SEQUENCE_ANY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ASN1_SET_ANY_it); &ASN1_SET_ANY_it);
} }
LCRYPTO_ALIAS(d2i_ASN1_SET_ANY);
int int
i2d_ASN1_SET_ANY(const ASN1_SEQUENCE_ANY *a, unsigned char **out) i2d_ASN1_SET_ANY(const ASN1_SEQUENCE_ANY *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_SET_ANY_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_SET_ANY_it);
} }
LCRYPTO_ALIAS(i2d_ASN1_SET_ANY);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: x_algor.c,v 1.23 2021/12/12 14:27:20 tb Exp $ */ /* $OpenBSD: x_algor.c,v 1.24 2023/07/05 21:23:37 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000. * project 2000.
*/ */
@ -109,24 +109,28 @@ d2i_X509_ALGOR(X509_ALGOR **a, const unsigned char **in, long len)
return (X509_ALGOR *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (X509_ALGOR *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&X509_ALGOR_it); &X509_ALGOR_it);
} }
LCRYPTO_ALIAS(d2i_X509_ALGOR);
int int
i2d_X509_ALGOR(X509_ALGOR *a, unsigned char **out) i2d_X509_ALGOR(X509_ALGOR *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_ALGOR_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_ALGOR_it);
} }
LCRYPTO_ALIAS(i2d_X509_ALGOR);
X509_ALGOR * X509_ALGOR *
X509_ALGOR_new(void) X509_ALGOR_new(void)
{ {
return (X509_ALGOR *)ASN1_item_new(&X509_ALGOR_it); return (X509_ALGOR *)ASN1_item_new(&X509_ALGOR_it);
} }
LCRYPTO_ALIAS(X509_ALGOR_new);
void void
X509_ALGOR_free(X509_ALGOR *a) X509_ALGOR_free(X509_ALGOR *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &X509_ALGOR_it); ASN1_item_free((ASN1_VALUE *)a, &X509_ALGOR_it);
} }
LCRYPTO_ALIAS(X509_ALGOR_free);
X509_ALGORS * X509_ALGORS *
d2i_X509_ALGORS(X509_ALGORS **a, const unsigned char **in, long len) d2i_X509_ALGORS(X509_ALGORS **a, const unsigned char **in, long len)
@ -134,18 +138,21 @@ d2i_X509_ALGORS(X509_ALGORS **a, const unsigned char **in, long len)
return (X509_ALGORS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (X509_ALGORS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&X509_ALGORS_it); &X509_ALGORS_it);
} }
LCRYPTO_ALIAS(d2i_X509_ALGORS);
int int
i2d_X509_ALGORS(X509_ALGORS *a, unsigned char **out) i2d_X509_ALGORS(X509_ALGORS *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_ALGORS_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_ALGORS_it);
} }
LCRYPTO_ALIAS(i2d_X509_ALGORS);
X509_ALGOR * X509_ALGOR *
X509_ALGOR_dup(X509_ALGOR *x) X509_ALGOR_dup(X509_ALGOR *x)
{ {
return ASN1_item_dup(&X509_ALGOR_it, x); return ASN1_item_dup(&X509_ALGOR_it, x);
} }
LCRYPTO_ALIAS(X509_ALGOR_dup);
int int
X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval) X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval)
@ -174,6 +181,7 @@ X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval)
ASN1_TYPE_set(alg->parameter, ptype, pval); ASN1_TYPE_set(alg->parameter, ptype, pval);
return 1; return 1;
} }
LCRYPTO_ALIAS(X509_ALGOR_set0);
void void
X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype, const void **ppval, X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype, const void **ppval,
@ -191,6 +199,7 @@ X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype, const void **ppval,
*ppval = algor->parameter->value.ptr; *ppval = algor->parameter->value.ptr;
} }
} }
LCRYPTO_ALIAS(X509_ALGOR_get0);
/* Set up an X509_ALGOR DigestAlgorithmIdentifier from an EVP_MD */ /* Set up an X509_ALGOR DigestAlgorithmIdentifier from an EVP_MD */
@ -204,6 +213,7 @@ X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md)
X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), param_type, NULL); X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), param_type, NULL);
} }
LCRYPTO_ALIAS(X509_ALGOR_set_md);
/* Returns 0 if they are equal, != 0 otherwise. */ /* Returns 0 if they are equal, != 0 otherwise. */
int int
@ -218,3 +228,4 @@ X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b)
} }
return(rv); return(rv);
} }
LCRYPTO_ALIAS(X509_ALGOR_cmp);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: x_attrib.c,v 1.18 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: x_attrib.c,v 1.19 2023/07/05 21:23:37 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -111,30 +111,35 @@ d2i_X509_ATTRIBUTE(X509_ATTRIBUTE **a, const unsigned char **in, long len)
return (X509_ATTRIBUTE *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (X509_ATTRIBUTE *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&X509_ATTRIBUTE_it); &X509_ATTRIBUTE_it);
} }
LCRYPTO_ALIAS(d2i_X509_ATTRIBUTE);
int int
i2d_X509_ATTRIBUTE(X509_ATTRIBUTE *a, unsigned char **out) i2d_X509_ATTRIBUTE(X509_ATTRIBUTE *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_ATTRIBUTE_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_ATTRIBUTE_it);
} }
LCRYPTO_ALIAS(i2d_X509_ATTRIBUTE);
X509_ATTRIBUTE * X509_ATTRIBUTE *
X509_ATTRIBUTE_new(void) X509_ATTRIBUTE_new(void)
{ {
return (X509_ATTRIBUTE *)ASN1_item_new(&X509_ATTRIBUTE_it); return (X509_ATTRIBUTE *)ASN1_item_new(&X509_ATTRIBUTE_it);
} }
LCRYPTO_ALIAS(X509_ATTRIBUTE_new);
void void
X509_ATTRIBUTE_free(X509_ATTRIBUTE *a) X509_ATTRIBUTE_free(X509_ATTRIBUTE *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &X509_ATTRIBUTE_it); ASN1_item_free((ASN1_VALUE *)a, &X509_ATTRIBUTE_it);
} }
LCRYPTO_ALIAS(X509_ATTRIBUTE_free);
X509_ATTRIBUTE * X509_ATTRIBUTE *
X509_ATTRIBUTE_dup(X509_ATTRIBUTE *x) X509_ATTRIBUTE_dup(X509_ATTRIBUTE *x)
{ {
return ASN1_item_dup(&X509_ATTRIBUTE_it, x); return ASN1_item_dup(&X509_ATTRIBUTE_it, x);
} }
LCRYPTO_ALIAS(X509_ATTRIBUTE_dup);
X509_ATTRIBUTE * X509_ATTRIBUTE *
X509_ATTRIBUTE_create(int nid, int atrtype, void *value) X509_ATTRIBUTE_create(int nid, int atrtype, void *value)
@ -163,3 +168,4 @@ X509_ATTRIBUTE_create(int nid, int atrtype, void *value)
ASN1_TYPE_free(val); ASN1_TYPE_free(val);
return (NULL); return (NULL);
} }
LCRYPTO_ALIAS(X509_ATTRIBUTE_create);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: x_crl.c,v 1.39 2022/12/26 16:00:36 tb Exp $ */ /* $OpenBSD: x_crl.c,v 1.40 2023/07/05 21:23:37 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -442,30 +442,35 @@ d2i_X509_REVOKED(X509_REVOKED **a, const unsigned char **in, long len)
return (X509_REVOKED *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (X509_REVOKED *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&X509_REVOKED_it); &X509_REVOKED_it);
} }
LCRYPTO_ALIAS(d2i_X509_REVOKED);
int int
i2d_X509_REVOKED(X509_REVOKED *a, unsigned char **out) i2d_X509_REVOKED(X509_REVOKED *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REVOKED_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REVOKED_it);
} }
LCRYPTO_ALIAS(i2d_X509_REVOKED);
X509_REVOKED * X509_REVOKED *
X509_REVOKED_new(void) X509_REVOKED_new(void)
{ {
return (X509_REVOKED *)ASN1_item_new(&X509_REVOKED_it); return (X509_REVOKED *)ASN1_item_new(&X509_REVOKED_it);
} }
LCRYPTO_ALIAS(X509_REVOKED_new);
void void
X509_REVOKED_free(X509_REVOKED *a) X509_REVOKED_free(X509_REVOKED *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &X509_REVOKED_it); ASN1_item_free((ASN1_VALUE *)a, &X509_REVOKED_it);
} }
LCRYPTO_ALIAS(X509_REVOKED_free);
X509_REVOKED * X509_REVOKED *
X509_REVOKED_dup(X509_REVOKED *a) X509_REVOKED_dup(X509_REVOKED *a)
{ {
return ASN1_item_dup(&X509_REVOKED_it, a); return ASN1_item_dup(&X509_REVOKED_it, a);
} }
LCRYPTO_ALIAS(X509_REVOKED_dup);
X509_CRL_INFO * X509_CRL_INFO *
d2i_X509_CRL_INFO(X509_CRL_INFO **a, const unsigned char **in, long len) d2i_X509_CRL_INFO(X509_CRL_INFO **a, const unsigned char **in, long len)
@ -473,24 +478,28 @@ d2i_X509_CRL_INFO(X509_CRL_INFO **a, const unsigned char **in, long len)
return (X509_CRL_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (X509_CRL_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&X509_CRL_INFO_it); &X509_CRL_INFO_it);
} }
LCRYPTO_ALIAS(d2i_X509_CRL_INFO);
int int
i2d_X509_CRL_INFO(X509_CRL_INFO *a, unsigned char **out) i2d_X509_CRL_INFO(X509_CRL_INFO *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_CRL_INFO_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_CRL_INFO_it);
} }
LCRYPTO_ALIAS(i2d_X509_CRL_INFO);
X509_CRL_INFO * X509_CRL_INFO *
X509_CRL_INFO_new(void) X509_CRL_INFO_new(void)
{ {
return (X509_CRL_INFO *)ASN1_item_new(&X509_CRL_INFO_it); return (X509_CRL_INFO *)ASN1_item_new(&X509_CRL_INFO_it);
} }
LCRYPTO_ALIAS(X509_CRL_INFO_new);
void void
X509_CRL_INFO_free(X509_CRL_INFO *a) X509_CRL_INFO_free(X509_CRL_INFO *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &X509_CRL_INFO_it); ASN1_item_free((ASN1_VALUE *)a, &X509_CRL_INFO_it);
} }
LCRYPTO_ALIAS(X509_CRL_INFO_free);
X509_CRL * X509_CRL *
d2i_X509_CRL(X509_CRL **a, const unsigned char **in, long len) d2i_X509_CRL(X509_CRL **a, const unsigned char **in, long len)
@ -498,30 +507,35 @@ d2i_X509_CRL(X509_CRL **a, const unsigned char **in, long len)
return (X509_CRL *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (X509_CRL *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&X509_CRL_it); &X509_CRL_it);
} }
LCRYPTO_ALIAS(d2i_X509_CRL);
int int
i2d_X509_CRL(X509_CRL *a, unsigned char **out) i2d_X509_CRL(X509_CRL *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_CRL_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_CRL_it);
} }
LCRYPTO_ALIAS(i2d_X509_CRL);
X509_CRL * X509_CRL *
X509_CRL_new(void) X509_CRL_new(void)
{ {
return (X509_CRL *)ASN1_item_new(&X509_CRL_it); return (X509_CRL *)ASN1_item_new(&X509_CRL_it);
} }
LCRYPTO_ALIAS(X509_CRL_new);
void void
X509_CRL_free(X509_CRL *a) X509_CRL_free(X509_CRL *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &X509_CRL_it); ASN1_item_free((ASN1_VALUE *)a, &X509_CRL_it);
} }
LCRYPTO_ALIAS(X509_CRL_free);
X509_CRL * X509_CRL *
X509_CRL_dup(X509_CRL *x) X509_CRL_dup(X509_CRL *x)
{ {
return ASN1_item_dup(&X509_CRL_it, x); return ASN1_item_dup(&X509_CRL_it, x);
} }
LCRYPTO_ALIAS(X509_CRL_dup);
static int static int
X509_REVOKED_cmp(const X509_REVOKED * const *a, const X509_REVOKED * const *b) X509_REVOKED_cmp(const X509_REVOKED * const *a, const X509_REVOKED * const *b)
@ -544,6 +558,7 @@ X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev)
inf->enc.modified = 1; inf->enc.modified = 1;
return 1; return 1;
} }
LCRYPTO_ALIAS(X509_CRL_add0_revoked);
int int
X509_CRL_verify(X509_CRL *crl, EVP_PKEY *r) X509_CRL_verify(X509_CRL *crl, EVP_PKEY *r)
@ -552,6 +567,7 @@ X509_CRL_verify(X509_CRL *crl, EVP_PKEY *r)
return crl->meth->crl_verify(crl, r); return crl->meth->crl_verify(crl, r);
return 0; return 0;
} }
LCRYPTO_ALIAS(X509_CRL_verify);
int int
X509_CRL_get0_by_serial(X509_CRL *crl, X509_REVOKED **ret, X509_CRL_get0_by_serial(X509_CRL *crl, X509_REVOKED **ret,
@ -561,6 +577,7 @@ X509_CRL_get0_by_serial(X509_CRL *crl, X509_REVOKED **ret,
return crl->meth->crl_lookup(crl, ret, serial, NULL); return crl->meth->crl_lookup(crl, ret, serial, NULL);
return 0; return 0;
} }
LCRYPTO_ALIAS(X509_CRL_get0_by_serial);
int int
X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x) X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x)
@ -570,6 +587,7 @@ X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x)
X509_get_serialNumber(x), X509_get_issuer_name(x)); X509_get_serialNumber(x), X509_get_issuer_name(x));
return 0; return 0;
} }
LCRYPTO_ALIAS(X509_CRL_get0_by_cert);
static int static int
def_crl_verify(X509_CRL *crl, EVP_PKEY *r) def_crl_verify(X509_CRL *crl, EVP_PKEY *r)
@ -648,6 +666,7 @@ X509_CRL_set_default_method(const X509_CRL_METHOD *meth)
else else
default_crl_method = meth; default_crl_method = meth;
} }
LCRYPTO_ALIAS(X509_CRL_set_default_method);
X509_CRL_METHOD * X509_CRL_METHOD *
X509_CRL_METHOD_new(int (*crl_init)(X509_CRL *crl), X509_CRL_METHOD_new(int (*crl_init)(X509_CRL *crl),
@ -669,6 +688,7 @@ X509_CRL_METHOD_new(int (*crl_init)(X509_CRL *crl),
return m; return m;
} }
LCRYPTO_ALIAS(X509_CRL_METHOD_new);
void void
X509_CRL_METHOD_free(X509_CRL_METHOD *m) X509_CRL_METHOD_free(X509_CRL_METHOD *m)
@ -679,72 +699,84 @@ X509_CRL_METHOD_free(X509_CRL_METHOD *m)
return; return;
free(m); free(m);
} }
LCRYPTO_ALIAS(X509_CRL_METHOD_free);
void void
X509_CRL_set_meth_data(X509_CRL *crl, void *dat) X509_CRL_set_meth_data(X509_CRL *crl, void *dat)
{ {
crl->meth_data = dat; crl->meth_data = dat;
} }
LCRYPTO_ALIAS(X509_CRL_set_meth_data);
void * void *
X509_CRL_get_meth_data(X509_CRL *crl) X509_CRL_get_meth_data(X509_CRL *crl)
{ {
return crl->meth_data; return crl->meth_data;
} }
LCRYPTO_ALIAS(X509_CRL_get_meth_data);
int int
X509_CRL_get_signature_nid(const X509_CRL *crl) X509_CRL_get_signature_nid(const X509_CRL *crl)
{ {
return OBJ_obj2nid(crl->sig_alg->algorithm); return OBJ_obj2nid(crl->sig_alg->algorithm);
} }
LCRYPTO_ALIAS(X509_CRL_get_signature_nid);
const STACK_OF(X509_EXTENSION) * const STACK_OF(X509_EXTENSION) *
X509_CRL_get0_extensions(const X509_CRL *crl) X509_CRL_get0_extensions(const X509_CRL *crl)
{ {
return crl->crl->extensions; return crl->crl->extensions;
} }
LCRYPTO_ALIAS(X509_CRL_get0_extensions);
long long
X509_CRL_get_version(const X509_CRL *crl) X509_CRL_get_version(const X509_CRL *crl)
{ {
return ASN1_INTEGER_get(crl->crl->version); return ASN1_INTEGER_get(crl->crl->version);
} }
LCRYPTO_ALIAS(X509_CRL_get_version);
const ASN1_TIME * const ASN1_TIME *
X509_CRL_get0_lastUpdate(const X509_CRL *crl) X509_CRL_get0_lastUpdate(const X509_CRL *crl)
{ {
return crl->crl->lastUpdate; return crl->crl->lastUpdate;
} }
LCRYPTO_ALIAS(X509_CRL_get0_lastUpdate);
ASN1_TIME * ASN1_TIME *
X509_CRL_get_lastUpdate(X509_CRL *crl) X509_CRL_get_lastUpdate(X509_CRL *crl)
{ {
return crl->crl->lastUpdate; return crl->crl->lastUpdate;
} }
LCRYPTO_ALIAS(X509_CRL_get_lastUpdate);
const ASN1_TIME * const ASN1_TIME *
X509_CRL_get0_nextUpdate(const X509_CRL *crl) X509_CRL_get0_nextUpdate(const X509_CRL *crl)
{ {
return crl->crl->nextUpdate; return crl->crl->nextUpdate;
} }
LCRYPTO_ALIAS(X509_CRL_get0_nextUpdate);
ASN1_TIME * ASN1_TIME *
X509_CRL_get_nextUpdate(X509_CRL *crl) X509_CRL_get_nextUpdate(X509_CRL *crl)
{ {
return crl->crl->nextUpdate; return crl->crl->nextUpdate;
} }
LCRYPTO_ALIAS(X509_CRL_get_nextUpdate);
X509_NAME * X509_NAME *
X509_CRL_get_issuer(const X509_CRL *crl) X509_CRL_get_issuer(const X509_CRL *crl)
{ {
return crl->crl->issuer; return crl->crl->issuer;
} }
LCRYPTO_ALIAS(X509_CRL_get_issuer);
STACK_OF(X509_REVOKED) * STACK_OF(X509_REVOKED) *
X509_CRL_get_REVOKED(X509_CRL *crl) X509_CRL_get_REVOKED(X509_CRL *crl)
{ {
return crl->crl->revoked; return crl->crl->revoked;
} }
LCRYPTO_ALIAS(X509_CRL_get_REVOKED);
void void
X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig, X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig,
@ -755,9 +787,11 @@ X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig,
if (palg != NULL) if (palg != NULL)
*palg = crl->sig_alg; *palg = crl->sig_alg;
} }
LCRYPTO_ALIAS(X509_CRL_get0_signature);
const X509_ALGOR * const X509_ALGOR *
X509_CRL_get0_tbs_sigalg(const X509_CRL *crl) X509_CRL_get0_tbs_sigalg(const X509_CRL *crl)
{ {
return crl->crl->sig_alg; return crl->crl->sig_alg;
} }
LCRYPTO_ALIAS(X509_CRL_get0_tbs_sigalg);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: x_exten.c,v 1.18 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: x_exten.c,v 1.19 2023/07/05 21:23:37 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000. * project 2000.
*/ */
@ -116,24 +116,28 @@ d2i_X509_EXTENSION(X509_EXTENSION **a, const unsigned char **in, long len)
return (X509_EXTENSION *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (X509_EXTENSION *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&X509_EXTENSION_it); &X509_EXTENSION_it);
} }
LCRYPTO_ALIAS(d2i_X509_EXTENSION);
int int
i2d_X509_EXTENSION(X509_EXTENSION *a, unsigned char **out) i2d_X509_EXTENSION(X509_EXTENSION *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_EXTENSION_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_EXTENSION_it);
} }
LCRYPTO_ALIAS(i2d_X509_EXTENSION);
X509_EXTENSION * X509_EXTENSION *
X509_EXTENSION_new(void) X509_EXTENSION_new(void)
{ {
return (X509_EXTENSION *)ASN1_item_new(&X509_EXTENSION_it); return (X509_EXTENSION *)ASN1_item_new(&X509_EXTENSION_it);
} }
LCRYPTO_ALIAS(X509_EXTENSION_new);
void void
X509_EXTENSION_free(X509_EXTENSION *a) X509_EXTENSION_free(X509_EXTENSION *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &X509_EXTENSION_it); ASN1_item_free((ASN1_VALUE *)a, &X509_EXTENSION_it);
} }
LCRYPTO_ALIAS(X509_EXTENSION_free);
X509_EXTENSIONS * X509_EXTENSIONS *
d2i_X509_EXTENSIONS(X509_EXTENSIONS **a, const unsigned char **in, long len) d2i_X509_EXTENSIONS(X509_EXTENSIONS **a, const unsigned char **in, long len)
@ -141,15 +145,18 @@ d2i_X509_EXTENSIONS(X509_EXTENSIONS **a, const unsigned char **in, long len)
return (X509_EXTENSIONS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (X509_EXTENSIONS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&X509_EXTENSIONS_it); &X509_EXTENSIONS_it);
} }
LCRYPTO_ALIAS(d2i_X509_EXTENSIONS);
int int
i2d_X509_EXTENSIONS(X509_EXTENSIONS *a, unsigned char **out) i2d_X509_EXTENSIONS(X509_EXTENSIONS *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_EXTENSIONS_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_EXTENSIONS_it);
} }
LCRYPTO_ALIAS(i2d_X509_EXTENSIONS);
X509_EXTENSION * X509_EXTENSION *
X509_EXTENSION_dup(X509_EXTENSION *x) X509_EXTENSION_dup(X509_EXTENSION *x)
{ {
return ASN1_item_dup(&X509_EXTENSION_it, x); return ASN1_item_dup(&X509_EXTENSION_it, x);
} }
LCRYPTO_ALIAS(X509_EXTENSION_dup);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: x_info.c,v 1.18 2020/09/03 17:29:05 tb Exp $ */ /* $OpenBSD: x_info.c,v 1.19 2023/07/05 21:23:37 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -75,6 +75,7 @@ X509_INFO_new(void)
return ret; return ret;
} }
LCRYPTO_ALIAS(X509_INFO_new);
void void
X509_INFO_free(X509_INFO *x) X509_INFO_free(X509_INFO *x)
@ -92,3 +93,4 @@ X509_INFO_free(X509_INFO *x)
free(x); free(x);
} }
LCRYPTO_ALIAS(X509_INFO_free);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: x_name.c,v 1.38 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: x_name.c,v 1.39 2023/07/05 21:23:37 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -117,30 +117,35 @@ d2i_X509_NAME_ENTRY(X509_NAME_ENTRY **a, const unsigned char **in, long len)
return (X509_NAME_ENTRY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (X509_NAME_ENTRY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&X509_NAME_ENTRY_it); &X509_NAME_ENTRY_it);
} }
LCRYPTO_ALIAS(d2i_X509_NAME_ENTRY);
int int
i2d_X509_NAME_ENTRY(X509_NAME_ENTRY *a, unsigned char **out) i2d_X509_NAME_ENTRY(X509_NAME_ENTRY *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_NAME_ENTRY_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_NAME_ENTRY_it);
} }
LCRYPTO_ALIAS(i2d_X509_NAME_ENTRY);
X509_NAME_ENTRY * X509_NAME_ENTRY *
X509_NAME_ENTRY_new(void) X509_NAME_ENTRY_new(void)
{ {
return (X509_NAME_ENTRY *)ASN1_item_new(&X509_NAME_ENTRY_it); return (X509_NAME_ENTRY *)ASN1_item_new(&X509_NAME_ENTRY_it);
} }
LCRYPTO_ALIAS(X509_NAME_ENTRY_new);
void void
X509_NAME_ENTRY_free(X509_NAME_ENTRY *a) X509_NAME_ENTRY_free(X509_NAME_ENTRY *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &X509_NAME_ENTRY_it); ASN1_item_free((ASN1_VALUE *)a, &X509_NAME_ENTRY_it);
} }
LCRYPTO_ALIAS(X509_NAME_ENTRY_free);
X509_NAME_ENTRY * X509_NAME_ENTRY *
X509_NAME_ENTRY_dup(X509_NAME_ENTRY *x) X509_NAME_ENTRY_dup(X509_NAME_ENTRY *x)
{ {
return ASN1_item_dup(&X509_NAME_ENTRY_it, x); return ASN1_item_dup(&X509_NAME_ENTRY_it, x);
} }
LCRYPTO_ALIAS(X509_NAME_ENTRY_dup);
/* For the "Name" type we need a SEQUENCE OF { SET OF X509_NAME_ENTRY } /* For the "Name" type we need a SEQUENCE OF { SET OF X509_NAME_ENTRY }
* so declare two template wrappers for this * so declare two template wrappers for this
@ -214,30 +219,35 @@ d2i_X509_NAME(X509_NAME **a, const unsigned char **in, long len)
return (X509_NAME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (X509_NAME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&X509_NAME_it); &X509_NAME_it);
} }
LCRYPTO_ALIAS(d2i_X509_NAME);
int int
i2d_X509_NAME(X509_NAME *a, unsigned char **out) i2d_X509_NAME(X509_NAME *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_NAME_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_NAME_it);
} }
LCRYPTO_ALIAS(i2d_X509_NAME);
X509_NAME * X509_NAME *
X509_NAME_new(void) X509_NAME_new(void)
{ {
return (X509_NAME *)ASN1_item_new(&X509_NAME_it); return (X509_NAME *)ASN1_item_new(&X509_NAME_it);
} }
LCRYPTO_ALIAS(X509_NAME_new);
void void
X509_NAME_free(X509_NAME *a) X509_NAME_free(X509_NAME *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &X509_NAME_it); ASN1_item_free((ASN1_VALUE *)a, &X509_NAME_it);
} }
LCRYPTO_ALIAS(X509_NAME_free);
X509_NAME * X509_NAME *
X509_NAME_dup(X509_NAME *x) X509_NAME_dup(X509_NAME *x)
{ {
return ASN1_item_dup(&X509_NAME_it, x); return ASN1_item_dup(&X509_NAME_it, x);
} }
LCRYPTO_ALIAS(X509_NAME_dup);
static int static int
x509_name_ex_new(ASN1_VALUE **val, const ASN1_ITEM *it) x509_name_ex_new(ASN1_VALUE **val, const ASN1_ITEM *it)
@ -635,6 +645,7 @@ X509_NAME_set(X509_NAME **xn, X509_NAME *name)
*xn = name; *xn = name;
return 1; return 1;
} }
LCRYPTO_ALIAS(X509_NAME_set);
int int
X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder, size_t *pderlen) X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder, size_t *pderlen)
@ -648,3 +659,4 @@ X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder, size_t *pderlen)
*pderlen = nm->bytes->length; *pderlen = nm->bytes->length;
return 1; return 1;
} }
LCRYPTO_ALIAS(X509_NAME_get0_der);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: x_pkey.c,v 1.21 2021/12/25 13:17:48 jsing Exp $ */ /* $OpenBSD: x_pkey.c,v 1.22 2023/07/05 21:23:37 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -98,6 +98,7 @@ X509_PKEY_new(void)
} }
return NULL; return NULL;
} }
LCRYPTO_ALIAS(X509_PKEY_new);
void void
X509_PKEY_free(X509_PKEY *x) X509_PKEY_free(X509_PKEY *x)
@ -119,3 +120,4 @@ X509_PKEY_free(X509_PKEY *x)
free(x->key_data); free(x->key_data);
free(x); free(x);
} }
LCRYPTO_ALIAS(X509_PKEY_free);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: x_pubkey.c,v 1.33 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: x_pubkey.c,v 1.34 2023/07/05 21:23:37 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -118,24 +118,28 @@ d2i_X509_PUBKEY(X509_PUBKEY **a, const unsigned char **in, long len)
return (X509_PUBKEY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (X509_PUBKEY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&X509_PUBKEY_it); &X509_PUBKEY_it);
} }
LCRYPTO_ALIAS(d2i_X509_PUBKEY);
int int
i2d_X509_PUBKEY(X509_PUBKEY *a, unsigned char **out) i2d_X509_PUBKEY(X509_PUBKEY *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_PUBKEY_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_PUBKEY_it);
} }
LCRYPTO_ALIAS(i2d_X509_PUBKEY);
X509_PUBKEY * X509_PUBKEY *
X509_PUBKEY_new(void) X509_PUBKEY_new(void)
{ {
return (X509_PUBKEY *)ASN1_item_new(&X509_PUBKEY_it); return (X509_PUBKEY *)ASN1_item_new(&X509_PUBKEY_it);
} }
LCRYPTO_ALIAS(X509_PUBKEY_new);
void void
X509_PUBKEY_free(X509_PUBKEY *a) X509_PUBKEY_free(X509_PUBKEY *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &X509_PUBKEY_it); ASN1_item_free((ASN1_VALUE *)a, &X509_PUBKEY_it);
} }
LCRYPTO_ALIAS(X509_PUBKEY_free);
int int
X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey)
@ -174,6 +178,7 @@ X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey)
X509_PUBKEY_free(pk); X509_PUBKEY_free(pk);
return 0; return 0;
} }
LCRYPTO_ALIAS(X509_PUBKEY_set);
EVP_PKEY * EVP_PKEY *
X509_PUBKEY_get0(X509_PUBKEY *key) X509_PUBKEY_get0(X509_PUBKEY *key)
@ -226,6 +231,7 @@ X509_PUBKEY_get0(X509_PUBKEY *key)
EVP_PKEY_free(ret); EVP_PKEY_free(ret);
return (NULL); return (NULL);
} }
LCRYPTO_ALIAS(X509_PUBKEY_get0);
EVP_PKEY * EVP_PKEY *
X509_PUBKEY_get(X509_PUBKEY *key) X509_PUBKEY_get(X509_PUBKEY *key)
@ -239,6 +245,7 @@ X509_PUBKEY_get(X509_PUBKEY *key)
return pkey; return pkey;
} }
LCRYPTO_ALIAS(X509_PUBKEY_get);
/* /*
* Decode an X509_PUBKEY into the specified key type. * Decode an X509_PUBKEY into the specified key type.
@ -403,12 +410,14 @@ d2i_PUBKEY(EVP_PKEY **pkey, const unsigned char **in, long len)
return (EVP_PKEY *)ASN1_item_d2i((ASN1_VALUE **)pkey, in, len, return (EVP_PKEY *)ASN1_item_d2i((ASN1_VALUE **)pkey, in, len,
&EVP_PKEY_PUBKEY_it); &EVP_PKEY_PUBKEY_it);
} }
LCRYPTO_ALIAS(d2i_PUBKEY);
int int
i2d_PUBKEY(EVP_PKEY *pkey, unsigned char **out) i2d_PUBKEY(EVP_PKEY *pkey, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)pkey, out, &EVP_PKEY_PUBKEY_it); return ASN1_item_i2d((ASN1_VALUE *)pkey, out, &EVP_PKEY_PUBKEY_it);
} }
LCRYPTO_ALIAS(i2d_PUBKEY);
EVP_PKEY * EVP_PKEY *
d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **pkey) d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **pkey)
@ -416,12 +425,14 @@ d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **pkey)
return (EVP_PKEY *)ASN1_item_d2i_bio(&EVP_PKEY_PUBKEY_it, bp, return (EVP_PKEY *)ASN1_item_d2i_bio(&EVP_PKEY_PUBKEY_it, bp,
(ASN1_VALUE **)pkey); (ASN1_VALUE **)pkey);
} }
LCRYPTO_ALIAS(d2i_PUBKEY_bio);
int int
i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey) i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey)
{ {
return ASN1_item_i2d_bio(&EVP_PKEY_PUBKEY_it, bp, (ASN1_VALUE *)pkey); return ASN1_item_i2d_bio(&EVP_PKEY_PUBKEY_it, bp, (ASN1_VALUE *)pkey);
} }
LCRYPTO_ALIAS(i2d_PUBKEY_bio);
EVP_PKEY * EVP_PKEY *
d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **pkey) d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **pkey)
@ -429,12 +440,14 @@ d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **pkey)
return (EVP_PKEY *)ASN1_item_d2i_fp(&EVP_PKEY_PUBKEY_it, fp, return (EVP_PKEY *)ASN1_item_d2i_fp(&EVP_PKEY_PUBKEY_it, fp,
(ASN1_VALUE **)pkey); (ASN1_VALUE **)pkey);
} }
LCRYPTO_ALIAS(d2i_PUBKEY_fp);
int int
i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey) i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey)
{ {
return ASN1_item_i2d_fp(&EVP_PKEY_PUBKEY_it, fp, (ASN1_VALUE *)pkey); return ASN1_item_i2d_fp(&EVP_PKEY_PUBKEY_it, fp, (ASN1_VALUE *)pkey);
} }
LCRYPTO_ALIAS(i2d_PUBKEY_fp);
/* /*
* The following are equivalents but which return RSA and DSA keys. * The following are equivalents but which return RSA and DSA keys.
@ -497,36 +510,42 @@ d2i_RSA_PUBKEY(RSA **rsa, const unsigned char **in, long len)
return (RSA *)ASN1_item_d2i((ASN1_VALUE **)rsa, in, len, return (RSA *)ASN1_item_d2i((ASN1_VALUE **)rsa, in, len,
&RSA_PUBKEY_it); &RSA_PUBKEY_it);
} }
LCRYPTO_ALIAS(d2i_RSA_PUBKEY);
int int
i2d_RSA_PUBKEY(RSA *rsa, unsigned char **out) i2d_RSA_PUBKEY(RSA *rsa, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)rsa, out, &RSA_PUBKEY_it); return ASN1_item_i2d((ASN1_VALUE *)rsa, out, &RSA_PUBKEY_it);
} }
LCRYPTO_ALIAS(i2d_RSA_PUBKEY);
RSA * RSA *
d2i_RSA_PUBKEY_bio(BIO *bp, RSA **rsa) d2i_RSA_PUBKEY_bio(BIO *bp, RSA **rsa)
{ {
return (RSA *)ASN1_item_d2i_bio(&RSA_PUBKEY_it, bp, (ASN1_VALUE **)rsa); return (RSA *)ASN1_item_d2i_bio(&RSA_PUBKEY_it, bp, (ASN1_VALUE **)rsa);
} }
LCRYPTO_ALIAS(d2i_RSA_PUBKEY_bio);
int int
i2d_RSA_PUBKEY_bio(BIO *bp, RSA *rsa) i2d_RSA_PUBKEY_bio(BIO *bp, RSA *rsa)
{ {
return ASN1_item_i2d_bio(&RSA_PUBKEY_it, bp, (ASN1_VALUE *)rsa); return ASN1_item_i2d_bio(&RSA_PUBKEY_it, bp, (ASN1_VALUE *)rsa);
} }
LCRYPTO_ALIAS(i2d_RSA_PUBKEY_bio);
RSA * RSA *
d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa) d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa)
{ {
return (RSA *)ASN1_item_d2i_fp(&RSA_PUBKEY_it, fp, (ASN1_VALUE **)rsa); return (RSA *)ASN1_item_d2i_fp(&RSA_PUBKEY_it, fp, (ASN1_VALUE **)rsa);
} }
LCRYPTO_ALIAS(d2i_RSA_PUBKEY_fp);
int int
i2d_RSA_PUBKEY_fp(FILE *fp, RSA *rsa) i2d_RSA_PUBKEY_fp(FILE *fp, RSA *rsa)
{ {
return ASN1_item_i2d_fp(&RSA_PUBKEY_it, fp, (ASN1_VALUE *)rsa); return ASN1_item_i2d_fp(&RSA_PUBKEY_it, fp, (ASN1_VALUE *)rsa);
} }
LCRYPTO_ALIAS(i2d_RSA_PUBKEY_fp);
#endif #endif
#ifndef OPENSSL_NO_DSA #ifndef OPENSSL_NO_DSA
@ -587,36 +606,42 @@ d2i_DSA_PUBKEY(DSA **dsa, const unsigned char **in, long len)
return (DSA *)ASN1_item_d2i((ASN1_VALUE **)dsa, in, len, return (DSA *)ASN1_item_d2i((ASN1_VALUE **)dsa, in, len,
&DSA_PUBKEY_it); &DSA_PUBKEY_it);
} }
LCRYPTO_ALIAS(d2i_DSA_PUBKEY);
int int
i2d_DSA_PUBKEY(DSA *dsa, unsigned char **out) i2d_DSA_PUBKEY(DSA *dsa, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)dsa, out, &DSA_PUBKEY_it); return ASN1_item_i2d((ASN1_VALUE *)dsa, out, &DSA_PUBKEY_it);
} }
LCRYPTO_ALIAS(i2d_DSA_PUBKEY);
DSA * DSA *
d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa) d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa)
{ {
return (DSA *)ASN1_item_d2i_bio(&DSA_PUBKEY_it, bp, (ASN1_VALUE **)dsa); return (DSA *)ASN1_item_d2i_bio(&DSA_PUBKEY_it, bp, (ASN1_VALUE **)dsa);
} }
LCRYPTO_ALIAS(d2i_DSA_PUBKEY_bio);
int int
i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa) i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa)
{ {
return ASN1_item_i2d_bio(&DSA_PUBKEY_it, bp, (ASN1_VALUE *)dsa); return ASN1_item_i2d_bio(&DSA_PUBKEY_it, bp, (ASN1_VALUE *)dsa);
} }
LCRYPTO_ALIAS(i2d_DSA_PUBKEY_bio);
DSA * DSA *
d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa) d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa)
{ {
return (DSA *)ASN1_item_d2i_fp(&DSA_PUBKEY_it, fp, (ASN1_VALUE **)dsa); return (DSA *)ASN1_item_d2i_fp(&DSA_PUBKEY_it, fp, (ASN1_VALUE **)dsa);
} }
LCRYPTO_ALIAS(d2i_DSA_PUBKEY_fp);
int int
i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa) i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa)
{ {
return ASN1_item_i2d_fp(&DSA_PUBKEY_it, fp, (ASN1_VALUE *)dsa); return ASN1_item_i2d_fp(&DSA_PUBKEY_it, fp, (ASN1_VALUE *)dsa);
} }
LCRYPTO_ALIAS(i2d_DSA_PUBKEY_fp);
#endif #endif
@ -678,36 +703,42 @@ d2i_EC_PUBKEY(EC_KEY **ec, const unsigned char **in, long len)
return (EC_KEY *)ASN1_item_d2i((ASN1_VALUE **)ec, in, len, return (EC_KEY *)ASN1_item_d2i((ASN1_VALUE **)ec, in, len,
&EC_PUBKEY_it); &EC_PUBKEY_it);
} }
LCRYPTO_ALIAS(d2i_EC_PUBKEY);
int int
i2d_EC_PUBKEY(EC_KEY *ec, unsigned char **out) i2d_EC_PUBKEY(EC_KEY *ec, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)ec, out, &EC_PUBKEY_it); return ASN1_item_i2d((ASN1_VALUE *)ec, out, &EC_PUBKEY_it);
} }
LCRYPTO_ALIAS(i2d_EC_PUBKEY);
EC_KEY * EC_KEY *
d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **ec) d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **ec)
{ {
return (EC_KEY *)ASN1_item_d2i_bio(&EC_PUBKEY_it, bp, (ASN1_VALUE **)ec); return (EC_KEY *)ASN1_item_d2i_bio(&EC_PUBKEY_it, bp, (ASN1_VALUE **)ec);
} }
LCRYPTO_ALIAS(d2i_EC_PUBKEY_bio);
int int
i2d_EC_PUBKEY_bio(BIO *bp, EC_KEY *ec) i2d_EC_PUBKEY_bio(BIO *bp, EC_KEY *ec)
{ {
return ASN1_item_i2d_bio(&EC_PUBKEY_it, bp, (ASN1_VALUE *)ec); return ASN1_item_i2d_bio(&EC_PUBKEY_it, bp, (ASN1_VALUE *)ec);
} }
LCRYPTO_ALIAS(i2d_EC_PUBKEY_bio);
EC_KEY * EC_KEY *
d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **ec) d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **ec)
{ {
return (EC_KEY *)ASN1_item_d2i_fp(&EC_PUBKEY_it, fp, (ASN1_VALUE **)ec); return (EC_KEY *)ASN1_item_d2i_fp(&EC_PUBKEY_it, fp, (ASN1_VALUE **)ec);
} }
LCRYPTO_ALIAS(d2i_EC_PUBKEY_fp);
int int
i2d_EC_PUBKEY_fp(FILE *fp, EC_KEY *ec) i2d_EC_PUBKEY_fp(FILE *fp, EC_KEY *ec)
{ {
return ASN1_item_i2d_fp(&EC_PUBKEY_it, fp, (ASN1_VALUE *)ec); return ASN1_item_i2d_fp(&EC_PUBKEY_it, fp, (ASN1_VALUE *)ec);
} }
LCRYPTO_ALIAS(i2d_EC_PUBKEY_fp);
#endif #endif
int int
@ -724,6 +755,7 @@ X509_PUBKEY_set0_param(X509_PUBKEY *pub, ASN1_OBJECT *aobj, int ptype,
return asn1_abs_set_unused_bits(pub->public_key, 0); return asn1_abs_set_unused_bits(pub->public_key, 0);
} }
LCRYPTO_ALIAS(X509_PUBKEY_set0_param);
int int
X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg, const unsigned char **pk, X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg, const unsigned char **pk,
@ -739,3 +771,4 @@ X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg, const unsigned char **pk,
*pa = pub->algor; *pa = pub->algor;
return 1; return 1;
} }
LCRYPTO_ALIAS(X509_PUBKEY_get0_param);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: x_req.c,v 1.19 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: x_req.c,v 1.20 2023/07/05 21:23:37 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -143,24 +143,28 @@ d2i_X509_REQ_INFO(X509_REQ_INFO **a, const unsigned char **in, long len)
return (X509_REQ_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (X509_REQ_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&X509_REQ_INFO_it); &X509_REQ_INFO_it);
} }
LCRYPTO_ALIAS(d2i_X509_REQ_INFO);
int int
i2d_X509_REQ_INFO(X509_REQ_INFO *a, unsigned char **out) i2d_X509_REQ_INFO(X509_REQ_INFO *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REQ_INFO_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REQ_INFO_it);
} }
LCRYPTO_ALIAS(i2d_X509_REQ_INFO);
X509_REQ_INFO * X509_REQ_INFO *
X509_REQ_INFO_new(void) X509_REQ_INFO_new(void)
{ {
return (X509_REQ_INFO *)ASN1_item_new(&X509_REQ_INFO_it); return (X509_REQ_INFO *)ASN1_item_new(&X509_REQ_INFO_it);
} }
LCRYPTO_ALIAS(X509_REQ_INFO_new);
void void
X509_REQ_INFO_free(X509_REQ_INFO *a) X509_REQ_INFO_free(X509_REQ_INFO *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &X509_REQ_INFO_it); ASN1_item_free((ASN1_VALUE *)a, &X509_REQ_INFO_it);
} }
LCRYPTO_ALIAS(X509_REQ_INFO_free);
static const ASN1_AUX X509_REQ_aux = { static const ASN1_AUX X509_REQ_aux = {
.app_data = NULL, .app_data = NULL,
@ -203,36 +207,42 @@ d2i_X509_REQ(X509_REQ **a, const unsigned char **in, long len)
return (X509_REQ *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (X509_REQ *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&X509_REQ_it); &X509_REQ_it);
} }
LCRYPTO_ALIAS(d2i_X509_REQ);
int int
i2d_X509_REQ(X509_REQ *a, unsigned char **out) i2d_X509_REQ(X509_REQ *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REQ_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REQ_it);
} }
LCRYPTO_ALIAS(i2d_X509_REQ);
X509_REQ * X509_REQ *
X509_REQ_new(void) X509_REQ_new(void)
{ {
return (X509_REQ *)ASN1_item_new(&X509_REQ_it); return (X509_REQ *)ASN1_item_new(&X509_REQ_it);
} }
LCRYPTO_ALIAS(X509_REQ_new);
void void
X509_REQ_free(X509_REQ *a) X509_REQ_free(X509_REQ *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &X509_REQ_it); ASN1_item_free((ASN1_VALUE *)a, &X509_REQ_it);
} }
LCRYPTO_ALIAS(X509_REQ_free);
X509_REQ * X509_REQ *
X509_REQ_dup(X509_REQ *x) X509_REQ_dup(X509_REQ *x)
{ {
return ASN1_item_dup(&X509_REQ_it, x); return ASN1_item_dup(&X509_REQ_it, x);
} }
LCRYPTO_ALIAS(X509_REQ_dup);
int int
X509_REQ_get_signature_nid(const X509_REQ *req) X509_REQ_get_signature_nid(const X509_REQ *req)
{ {
return OBJ_obj2nid(req->sig_alg->algorithm); return OBJ_obj2nid(req->sig_alg->algorithm);
} }
LCRYPTO_ALIAS(X509_REQ_get_signature_nid);
void void
X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig, X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig,
@ -243,3 +253,4 @@ X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig,
if (palg != NULL) if (palg != NULL)
*palg = req->sig_alg; *palg = req->sig_alg;
} }
LCRYPTO_ALIAS(X509_REQ_get0_signature);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: x_sig.c,v 1.14 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: x_sig.c,v 1.15 2023/07/05 21:23:37 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -92,24 +92,28 @@ d2i_X509_SIG(X509_SIG **a, const unsigned char **in, long len)
return (X509_SIG *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (X509_SIG *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&X509_SIG_it); &X509_SIG_it);
} }
LCRYPTO_ALIAS(d2i_X509_SIG);
int int
i2d_X509_SIG(X509_SIG *a, unsigned char **out) i2d_X509_SIG(X509_SIG *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_SIG_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_SIG_it);
} }
LCRYPTO_ALIAS(i2d_X509_SIG);
X509_SIG * X509_SIG *
X509_SIG_new(void) X509_SIG_new(void)
{ {
return (X509_SIG *)ASN1_item_new(&X509_SIG_it); return (X509_SIG *)ASN1_item_new(&X509_SIG_it);
} }
LCRYPTO_ALIAS(X509_SIG_new);
void void
X509_SIG_free(X509_SIG *a) X509_SIG_free(X509_SIG *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &X509_SIG_it); ASN1_item_free((ASN1_VALUE *)a, &X509_SIG_it);
} }
LCRYPTO_ALIAS(X509_SIG_free);
void void
X509_SIG_get0(const X509_SIG *sig, const X509_ALGOR **palg, X509_SIG_get0(const X509_SIG *sig, const X509_ALGOR **palg,
@ -120,6 +124,7 @@ X509_SIG_get0(const X509_SIG *sig, const X509_ALGOR **palg,
if (pdigest != NULL) if (pdigest != NULL)
*pdigest = sig->digest; *pdigest = sig->digest;
} }
LCRYPTO_ALIAS(X509_SIG_get0);
void void
X509_SIG_getm(X509_SIG *sig, X509_ALGOR **palg, ASN1_OCTET_STRING **pdigest) X509_SIG_getm(X509_SIG *sig, X509_ALGOR **palg, ASN1_OCTET_STRING **pdigest)
@ -129,3 +134,4 @@ X509_SIG_getm(X509_SIG *sig, X509_ALGOR **palg, ASN1_OCTET_STRING **pdigest)
if (pdigest != NULL) if (pdigest != NULL)
*pdigest = sig->digest; *pdigest = sig->digest;
} }
LCRYPTO_ALIAS(X509_SIG_getm);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: x_spki.c,v 1.11 2015/02/11 04:00:39 jsing Exp $ */ /* $OpenBSD: x_spki.c,v 1.12 2023/07/05 21:23:37 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -94,24 +94,28 @@ d2i_NETSCAPE_SPKAC(NETSCAPE_SPKAC **a, const unsigned char **in, long len)
return (NETSCAPE_SPKAC *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (NETSCAPE_SPKAC *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&NETSCAPE_SPKAC_it); &NETSCAPE_SPKAC_it);
} }
LCRYPTO_ALIAS(d2i_NETSCAPE_SPKAC);
int int
i2d_NETSCAPE_SPKAC(NETSCAPE_SPKAC *a, unsigned char **out) i2d_NETSCAPE_SPKAC(NETSCAPE_SPKAC *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &NETSCAPE_SPKAC_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &NETSCAPE_SPKAC_it);
} }
LCRYPTO_ALIAS(i2d_NETSCAPE_SPKAC);
NETSCAPE_SPKAC * NETSCAPE_SPKAC *
NETSCAPE_SPKAC_new(void) NETSCAPE_SPKAC_new(void)
{ {
return (NETSCAPE_SPKAC *)ASN1_item_new(&NETSCAPE_SPKAC_it); return (NETSCAPE_SPKAC *)ASN1_item_new(&NETSCAPE_SPKAC_it);
} }
LCRYPTO_ALIAS(NETSCAPE_SPKAC_new);
void void
NETSCAPE_SPKAC_free(NETSCAPE_SPKAC *a) NETSCAPE_SPKAC_free(NETSCAPE_SPKAC *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &NETSCAPE_SPKAC_it); ASN1_item_free((ASN1_VALUE *)a, &NETSCAPE_SPKAC_it);
} }
LCRYPTO_ALIAS(NETSCAPE_SPKAC_free);
static const ASN1_TEMPLATE NETSCAPE_SPKI_seq_tt[] = { static const ASN1_TEMPLATE NETSCAPE_SPKI_seq_tt[] = {
{ {
@ -154,21 +158,25 @@ d2i_NETSCAPE_SPKI(NETSCAPE_SPKI **a, const unsigned char **in, long len)
return (NETSCAPE_SPKI *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (NETSCAPE_SPKI *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&NETSCAPE_SPKI_it); &NETSCAPE_SPKI_it);
} }
LCRYPTO_ALIAS(d2i_NETSCAPE_SPKI);
int int
i2d_NETSCAPE_SPKI(NETSCAPE_SPKI *a, unsigned char **out) i2d_NETSCAPE_SPKI(NETSCAPE_SPKI *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &NETSCAPE_SPKI_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &NETSCAPE_SPKI_it);
} }
LCRYPTO_ALIAS(i2d_NETSCAPE_SPKI);
NETSCAPE_SPKI * NETSCAPE_SPKI *
NETSCAPE_SPKI_new(void) NETSCAPE_SPKI_new(void)
{ {
return (NETSCAPE_SPKI *)ASN1_item_new(&NETSCAPE_SPKI_it); return (NETSCAPE_SPKI *)ASN1_item_new(&NETSCAPE_SPKI_it);
} }
LCRYPTO_ALIAS(NETSCAPE_SPKI_new);
void void
NETSCAPE_SPKI_free(NETSCAPE_SPKI *a) NETSCAPE_SPKI_free(NETSCAPE_SPKI *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &NETSCAPE_SPKI_it); ASN1_item_free((ASN1_VALUE *)a, &NETSCAPE_SPKI_it);
} }
LCRYPTO_ALIAS(NETSCAPE_SPKI_free);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: x_val.c,v 1.11 2015/02/11 04:00:39 jsing Exp $ */ /* $OpenBSD: x_val.c,v 1.12 2023/07/05 21:23:37 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -90,21 +90,25 @@ d2i_X509_VAL(X509_VAL **a, const unsigned char **in, long len)
return (X509_VAL *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (X509_VAL *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&X509_VAL_it); &X509_VAL_it);
} }
LCRYPTO_ALIAS(d2i_X509_VAL);
int int
i2d_X509_VAL(X509_VAL *a, unsigned char **out) i2d_X509_VAL(X509_VAL *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_VAL_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_VAL_it);
} }
LCRYPTO_ALIAS(i2d_X509_VAL);
X509_VAL * X509_VAL *
X509_VAL_new(void) X509_VAL_new(void)
{ {
return (X509_VAL *)ASN1_item_new(&X509_VAL_it); return (X509_VAL *)ASN1_item_new(&X509_VAL_it);
} }
LCRYPTO_ALIAS(X509_VAL_new);
void void
X509_VAL_free(X509_VAL *a) X509_VAL_free(X509_VAL *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &X509_VAL_it); ASN1_item_free((ASN1_VALUE *)a, &X509_VAL_it);
} }
LCRYPTO_ALIAS(X509_VAL_free);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: x_x509.c,v 1.35 2023/04/28 16:30:14 tb Exp $ */ /* $OpenBSD: x_x509.c,v 1.36 2023/07/05 21:23:37 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -149,24 +149,28 @@ d2i_X509_CINF(X509_CINF **a, const unsigned char **in, long len)
return (X509_CINF *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (X509_CINF *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&X509_CINF_it); &X509_CINF_it);
} }
LCRYPTO_ALIAS(d2i_X509_CINF);
int int
i2d_X509_CINF(X509_CINF *a, unsigned char **out) i2d_X509_CINF(X509_CINF *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_CINF_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_CINF_it);
} }
LCRYPTO_ALIAS(i2d_X509_CINF);
X509_CINF * X509_CINF *
X509_CINF_new(void) X509_CINF_new(void)
{ {
return (X509_CINF *)ASN1_item_new(&X509_CINF_it); return (X509_CINF *)ASN1_item_new(&X509_CINF_it);
} }
LCRYPTO_ALIAS(X509_CINF_new);
void void
X509_CINF_free(X509_CINF *a) X509_CINF_free(X509_CINF *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &X509_CINF_it); ASN1_item_free((ASN1_VALUE *)a, &X509_CINF_it);
} }
LCRYPTO_ALIAS(X509_CINF_free);
/* X509 top level structure needs a bit of customisation */ /* X509 top level structure needs a bit of customisation */
static int static int
@ -259,30 +263,35 @@ d2i_X509(X509 **a, const unsigned char **in, long len)
return (X509 *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (X509 *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&X509_it); &X509_it);
} }
LCRYPTO_ALIAS(d2i_X509);
int int
i2d_X509(X509 *a, unsigned char **out) i2d_X509(X509 *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_it);
} }
LCRYPTO_ALIAS(i2d_X509);
X509 * X509 *
X509_new(void) X509_new(void)
{ {
return (X509 *)ASN1_item_new(&X509_it); return (X509 *)ASN1_item_new(&X509_it);
} }
LCRYPTO_ALIAS(X509_new);
void void
X509_free(X509 *a) X509_free(X509 *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &X509_it); ASN1_item_free((ASN1_VALUE *)a, &X509_it);
} }
LCRYPTO_ALIAS(X509_free);
X509 * X509 *
X509_dup(X509 *x) X509_dup(X509 *x)
{ {
return ASN1_item_dup(&X509_it, x); return ASN1_item_dup(&X509_it, x);
} }
LCRYPTO_ALIAS(X509_dup);
int int
X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
@ -291,18 +300,21 @@ X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509, argl, argp, return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509, argl, argp,
new_func, dup_func, free_func); new_func, dup_func, free_func);
} }
LCRYPTO_ALIAS(X509_get_ex_new_index);
int int
X509_set_ex_data(X509 *r, int idx, void *arg) X509_set_ex_data(X509 *r, int idx, void *arg)
{ {
return (CRYPTO_set_ex_data(&r->ex_data, idx, arg)); return (CRYPTO_set_ex_data(&r->ex_data, idx, arg));
} }
LCRYPTO_ALIAS(X509_set_ex_data);
void * void *
X509_get_ex_data(X509 *r, int idx) X509_get_ex_data(X509 *r, int idx)
{ {
return (CRYPTO_get_ex_data(&r->ex_data, idx)); return (CRYPTO_get_ex_data(&r->ex_data, idx));
} }
LCRYPTO_ALIAS(X509_get_ex_data);
/* X509_AUX ASN1 routines. X509_AUX is the name given to /* X509_AUX ASN1 routines. X509_AUX is the name given to
* a certificate with extra info tagged on the end. Since these * a certificate with extra info tagged on the end. Since these
@ -340,6 +352,7 @@ d2i_X509_AUX(X509 **a, const unsigned char **pp, long length)
X509_free(ret); X509_free(ret);
return NULL; return NULL;
} }
LCRYPTO_ALIAS(d2i_X509_AUX);
int int
i2d_X509_AUX(X509 *a, unsigned char **pp) i2d_X509_AUX(X509 *a, unsigned char **pp)
@ -351,6 +364,7 @@ i2d_X509_AUX(X509 *a, unsigned char **pp)
length += i2d_X509_CERT_AUX(a->aux, pp); length += i2d_X509_CERT_AUX(a->aux, pp);
return length; return length;
} }
LCRYPTO_ALIAS(i2d_X509_AUX);
int int
i2d_re_X509_tbs(X509 *x, unsigned char **pp) i2d_re_X509_tbs(X509 *x, unsigned char **pp)
@ -358,6 +372,7 @@ i2d_re_X509_tbs(X509 *x, unsigned char **pp)
x->cert_info->enc.modified = 1; x->cert_info->enc.modified = 1;
return i2d_X509_CINF(x->cert_info, pp); return i2d_X509_CINF(x->cert_info, pp);
} }
LCRYPTO_ALIAS(i2d_re_X509_tbs);
void void
X509_get0_signature(const ASN1_BIT_STRING **psig, const X509_ALGOR **palg, X509_get0_signature(const ASN1_BIT_STRING **psig, const X509_ALGOR **palg,
@ -368,9 +383,11 @@ X509_get0_signature(const ASN1_BIT_STRING **psig, const X509_ALGOR **palg,
if (palg != NULL) if (palg != NULL)
*palg = x->sig_alg; *palg = x->sig_alg;
} }
LCRYPTO_ALIAS(X509_get0_signature);
int int
X509_get_signature_nid(const X509 *x) X509_get_signature_nid(const X509 *x)
{ {
return OBJ_obj2nid(x->sig_alg->algorithm); return OBJ_obj2nid(x->sig_alg->algorithm);
} }
LCRYPTO_ALIAS(X509_get_signature_nid);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: x_x509a.c,v 1.19 2022/11/26 16:08:50 tb Exp $ */ /* $OpenBSD: x_x509a.c,v 1.20 2023/07/05 21:23:37 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999. * project 1999.
*/ */
@ -126,24 +126,28 @@ d2i_X509_CERT_AUX(X509_CERT_AUX **a, const unsigned char **in, long len)
return (X509_CERT_AUX *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, return (X509_CERT_AUX *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&X509_CERT_AUX_it); &X509_CERT_AUX_it);
} }
LCRYPTO_ALIAS(d2i_X509_CERT_AUX);
int int
i2d_X509_CERT_AUX(X509_CERT_AUX *a, unsigned char **out) i2d_X509_CERT_AUX(X509_CERT_AUX *a, unsigned char **out)
{ {
return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_CERT_AUX_it); return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_CERT_AUX_it);
} }
LCRYPTO_ALIAS(i2d_X509_CERT_AUX);
X509_CERT_AUX * X509_CERT_AUX *
X509_CERT_AUX_new(void) X509_CERT_AUX_new(void)
{ {
return (X509_CERT_AUX *)ASN1_item_new(&X509_CERT_AUX_it); return (X509_CERT_AUX *)ASN1_item_new(&X509_CERT_AUX_it);
} }
LCRYPTO_ALIAS(X509_CERT_AUX_new);
void void
X509_CERT_AUX_free(X509_CERT_AUX *a) X509_CERT_AUX_free(X509_CERT_AUX *a)
{ {
ASN1_item_free((ASN1_VALUE *)a, &X509_CERT_AUX_it); ASN1_item_free((ASN1_VALUE *)a, &X509_CERT_AUX_it);
} }
LCRYPTO_ALIAS(X509_CERT_AUX_free);
static X509_CERT_AUX * static X509_CERT_AUX *
aux_get(X509 *x) aux_get(X509 *x)
@ -172,6 +176,7 @@ X509_alias_set1(X509 *x, const unsigned char *name, int len)
return 0; return 0;
return ASN1_STRING_set(aux->alias, name, len); return ASN1_STRING_set(aux->alias, name, len);
} }
LCRYPTO_ALIAS(X509_alias_set1);
int int
X509_keyid_set1(X509 *x, const unsigned char *id, int len) X509_keyid_set1(X509 *x, const unsigned char *id, int len)
@ -190,6 +195,7 @@ X509_keyid_set1(X509 *x, const unsigned char *id, int len)
return 0; return 0;
return ASN1_STRING_set(aux->keyid, id, len); return ASN1_STRING_set(aux->keyid, id, len);
} }
LCRYPTO_ALIAS(X509_keyid_set1);
unsigned char * unsigned char *
X509_alias_get0(X509 *x, int *len) X509_alias_get0(X509 *x, int *len)
@ -200,6 +206,7 @@ X509_alias_get0(X509 *x, int *len)
*len = x->aux->alias->length; *len = x->aux->alias->length;
return x->aux->alias->data; return x->aux->alias->data;
} }
LCRYPTO_ALIAS(X509_alias_get0);
unsigned char * unsigned char *
X509_keyid_get0(X509 *x, int *len) X509_keyid_get0(X509 *x, int *len)
@ -210,6 +217,7 @@ X509_keyid_get0(X509 *x, int *len)
*len = x->aux->keyid->length; *len = x->aux->keyid->length;
return x->aux->keyid->data; return x->aux->keyid->data;
} }
LCRYPTO_ALIAS(X509_keyid_get0);
int int
X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj) X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj)
@ -232,6 +240,7 @@ X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj)
ASN1_OBJECT_free(objtmp); ASN1_OBJECT_free(objtmp);
return 0; return 0;
} }
LCRYPTO_ALIAS(X509_add1_trust_object);
int int
X509_add1_reject_object(X509 *x, const ASN1_OBJECT *obj) X509_add1_reject_object(X509 *x, const ASN1_OBJECT *obj)
@ -254,6 +263,7 @@ X509_add1_reject_object(X509 *x, const ASN1_OBJECT *obj)
ASN1_OBJECT_free(objtmp); ASN1_OBJECT_free(objtmp);
return 0; return 0;
} }
LCRYPTO_ALIAS(X509_add1_reject_object);
void void
X509_trust_clear(X509 *x) X509_trust_clear(X509 *x)
@ -263,6 +273,7 @@ X509_trust_clear(X509 *x)
x->aux->trust = NULL; x->aux->trust = NULL;
} }
} }
LCRYPTO_ALIAS(X509_trust_clear);
void void
X509_reject_clear(X509 *x) X509_reject_clear(X509 *x)
@ -272,3 +283,4 @@ X509_reject_clear(X509 *x)
x->aux->reject = NULL; x->aux->reject = NULL;
} }
} }
LCRYPTO_ALIAS(X509_reject_clear);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: b_dump.c,v 1.23 2022/10/17 18:26:41 jsing Exp $ */ /* $OpenBSD: b_dump.c,v 1.24 2023/07/05 21:23:37 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -75,6 +75,7 @@ BIO_dump_cb(int (*cb)(const void *data, size_t len, void *u),
{ {
return BIO_dump_indent_cb(cb, u, s, len, 0); return BIO_dump_indent_cb(cb, u, s, len, 0);
} }
LCRYPTO_ALIAS(BIO_dump_cb);
int int
BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u), BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
@ -148,6 +149,7 @@ BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
#endif #endif
return (ret); return (ret);
} }
LCRYPTO_ALIAS(BIO_dump_indent_cb);
static int static int
write_fp(const void *data, size_t len, void *fp) write_fp(const void *data, size_t len, void *fp)
@ -160,12 +162,14 @@ BIO_dump_fp(FILE *fp, const char *s, int len)
{ {
return BIO_dump_cb(write_fp, fp, s, len); return BIO_dump_cb(write_fp, fp, s, len);
} }
LCRYPTO_ALIAS(BIO_dump_fp);
int int
BIO_dump_indent_fp(FILE *fp, const char *s, int len, int indent) BIO_dump_indent_fp(FILE *fp, const char *s, int len, int indent)
{ {
return BIO_dump_indent_cb(write_fp, fp, s, len, indent); return BIO_dump_indent_cb(write_fp, fp, s, len, indent);
} }
LCRYPTO_ALIAS(BIO_dump_indent_fp);
static int static int
write_bio(const void *data, size_t len, void *bp) write_bio(const void *data, size_t len, void *bp)
@ -178,9 +182,11 @@ BIO_dump(BIO *bp, const char *s, int len)
{ {
return BIO_dump_cb(write_bio, bp, s, len); return BIO_dump_cb(write_bio, bp, s, len);
} }
LCRYPTO_ALIAS(BIO_dump);
int int
BIO_dump_indent(BIO *bp, const char *s, int len, int indent) BIO_dump_indent(BIO *bp, const char *s, int len, int indent)
{ {
return BIO_dump_indent_cb(write_bio, bp, s, len, indent); return BIO_dump_indent_cb(write_bio, bp, s, len, indent);
} }
LCRYPTO_ALIAS(BIO_dump_indent);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: b_posix.c,v 1.2 2018/03/17 16:20:01 beck Exp $ */ /* $OpenBSD: b_posix.c,v 1.3 2023/07/05 21:23:37 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -72,11 +72,13 @@ BIO_sock_init(void)
return (0); return (0);
return (1); return (1);
} }
LCRYPTO_ALIAS(BIO_sock_init);
void void
BIO_sock_cleanup(void) BIO_sock_cleanup(void)
{ {
} }
LCRYPTO_ALIAS(BIO_sock_cleanup);
int int
BIO_socket_nbio(int s, int mode) BIO_socket_nbio(int s, int mode)
@ -88,3 +90,4 @@ BIO_socket_nbio(int s, int mode)
return (fcntl(s, F_SETFL, flags & ~O_NONBLOCK) != -1); return (fcntl(s, F_SETFL, flags & ~O_NONBLOCK) != -1);
return (1); return (1);
} }
LCRYPTO_ALIAS(BIO_socket_nbio);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: b_print.c,v 1.26 2019/06/28 05:47:57 deraadt Exp $ */ /* $OpenBSD: b_print.c,v 1.27 2023/07/05 21:23:37 beck Exp $ */
/* Theo de Raadt places this file in the public domain. */ /* Theo de Raadt places this file in the public domain. */
@ -15,6 +15,7 @@ BIO_printf(BIO *bio, const char *format, ...)
va_end(args); va_end(args);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(BIO_printf);
#ifdef HAVE_FUNOPEN #ifdef HAVE_FUNOPEN
static int static int
@ -39,6 +40,7 @@ BIO_vprintf(BIO *bio, const char *format, va_list args)
fail: fail:
return (ret); return (ret);
} }
LCRYPTO_ALIAS(BIO_vprintf);
#else /* !HAVE_FUNOPEN */ #else /* !HAVE_FUNOPEN */
@ -55,6 +57,7 @@ BIO_vprintf(BIO *bio, const char *format, va_list args)
free(buf); free(buf);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(BIO_vprintf);
#endif /* HAVE_FUNOPEN */ #endif /* HAVE_FUNOPEN */
@ -92,6 +95,7 @@ BIO_snprintf(char *buf, size_t n, const char *format, ...)
return (-1); return (-1);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(BIO_snprintf);
int int
BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
@ -104,3 +108,4 @@ BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
return (-1); return (-1);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(BIO_vsnprintf);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: b_sock.c,v 1.70 2022/12/22 20:13:45 schwarze Exp $ */ /* $OpenBSD: b_sock.c,v 1.71 2023/07/05 21:23:37 beck Exp $ */
/* /*
* Copyright (c) 2017 Bob Beck <beck@openbsd.org> * Copyright (c) 2017 Bob Beck <beck@openbsd.org>
* *
@ -62,6 +62,7 @@ BIO_get_host_ip(const char *str, unsigned char *ip)
freeaddrinfo(res); freeaddrinfo(res);
return (1); return (1);
} }
LCRYPTO_ALIAS(BIO_get_host_ip);
int int
BIO_get_port(const char *str, unsigned short *port_ptr) BIO_get_port(const char *str, unsigned short *port_ptr)
@ -89,6 +90,7 @@ BIO_get_port(const char *str, unsigned short *port_ptr)
freeaddrinfo(res); freeaddrinfo(res);
return (1); return (1);
} }
LCRYPTO_ALIAS(BIO_get_port);
int int
BIO_sock_error(int sock) BIO_sock_error(int sock)
@ -101,12 +103,14 @@ BIO_sock_error(int sock)
return (1); return (1);
return (err); return (err);
} }
LCRYPTO_ALIAS(BIO_sock_error);
struct hostent * struct hostent *
BIO_gethostbyname(const char *name) BIO_gethostbyname(const char *name)
{ {
return gethostbyname(name); return gethostbyname(name);
} }
LCRYPTO_ALIAS(BIO_gethostbyname);
int int
BIO_socket_ioctl(int fd, long type, void *arg) BIO_socket_ioctl(int fd, long type, void *arg)
@ -118,6 +122,7 @@ BIO_socket_ioctl(int fd, long type, void *arg)
SYSerror(errno); SYSerror(errno);
return (ret); return (ret);
} }
LCRYPTO_ALIAS(BIO_socket_ioctl);
int int
BIO_get_accept_socket(char *host, int bind_mode) BIO_get_accept_socket(char *host, int bind_mode)
@ -203,6 +208,7 @@ err:
} }
return (s); return (s);
} }
LCRYPTO_ALIAS(BIO_get_accept_socket);
int int
BIO_accept(int sock, char **addr) BIO_accept(int sock, char **addr)
@ -245,9 +251,11 @@ BIO_accept(int sock, char **addr)
end: end:
return (ret); return (ret);
} }
LCRYPTO_ALIAS(BIO_accept);
int int
BIO_set_tcp_ndelay(int s, int on) BIO_set_tcp_ndelay(int s, int on)
{ {
return (setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) == 0); return (setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) == 0);
} }
LCRYPTO_ALIAS(BIO_set_tcp_ndelay);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: bf_buff.c,v 1.27 2022/01/14 08:40:57 tb Exp $ */ /* $OpenBSD: bf_buff.c,v 1.28 2023/07/05 21:23:37 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -93,6 +93,7 @@ BIO_f_buffer(void)
{ {
return (&methods_buffer); return (&methods_buffer);
} }
LCRYPTO_ALIAS(BIO_f_buffer);
static int static int
buffer_new(BIO *bi) buffer_new(BIO *bi)

View file

@ -1,4 +1,4 @@
/* $OpenBSD: bf_nbio.c,v 1.22 2022/01/14 08:40:57 tb Exp $ */ /* $OpenBSD: bf_nbio.c,v 1.23 2023/07/05 21:23:37 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -100,6 +100,7 @@ BIO_f_nbio_test(void)
{ {
return (&methods_nbiof); return (&methods_nbiof);
} }
LCRYPTO_ALIAS(BIO_f_nbio_test);
static int static int
nbiof_new(BIO *bi) nbiof_new(BIO *bi)

View file

@ -1,4 +1,4 @@
/* $OpenBSD: bf_null.c,v 1.14 2022/01/14 08:40:57 tb Exp $ */ /* $OpenBSD: bf_null.c,v 1.15 2023/07/05 21:23:37 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -93,6 +93,7 @@ BIO_f_null(void)
{ {
return (&methods_nullf); return (&methods_nullf);
} }
LCRYPTO_ALIAS(BIO_f_null);
static int static int
nullf_new(BIO *bi) nullf_new(BIO *bi)

View file

@ -1,4 +1,4 @@
/* $OpenBSD: bio.h,v 1.56 2022/09/11 17:26:03 tb Exp $ */ /* $OpenBSD: bio.h,v 1.58 2023/07/05 19:25:01 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -255,7 +255,7 @@ void BIO_clear_flags(BIO *b, int flags);
* the BIO_CB_RETURN flag indicates if it is after the call. * the BIO_CB_RETURN flag indicates if it is after the call.
*/ */
#define BIO_CB_RETURN 0x80 #define BIO_CB_RETURN 0x80
#define BIO_CB_return(a) ((a)|BIO_CB_RETURN)) #define BIO_CB_return(a) ((a)|BIO_CB_RETURN)
#define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN)) #define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN))
#define BIO_cb_post(a) ((a)&BIO_CB_RETURN) #define BIO_cb_post(a) ((a)&BIO_CB_RETURN)
@ -536,17 +536,13 @@ unsigned long BIO_number_read(BIO *bio);
unsigned long BIO_number_written(BIO *bio); unsigned long BIO_number_written(BIO *bio);
/* For BIO_f_asn1() */ /* For BIO_f_asn1() */
int int BIO_asn1_set_prefix(BIO *b, asn1_ps_func *prefix,
BIO_asn1_set_prefix(BIO *b, asn1_ps_func *prefix,
asn1_ps_func *prefix_free); asn1_ps_func *prefix_free);
int int BIO_asn1_get_prefix(BIO *b, asn1_ps_func **pprefix,
BIO_asn1_get_prefix(BIO *b, asn1_ps_func **pprefix,
asn1_ps_func **pprefix_free); asn1_ps_func **pprefix_free);
int int BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix,
BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix,
asn1_ps_func *suffix_free); asn1_ps_func *suffix_free);
int int BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix,
BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix,
asn1_ps_func **psuffix_free); asn1_ps_func **psuffix_free);
int BIO_get_new_index(void); int BIO_get_new_index(void);
@ -667,20 +663,30 @@ void BIO_copy_next_retry(BIO *b);
/*long BIO_ghbn_ctrl(int cmd,int iarg,char *parg);*/ /*long BIO_ghbn_ctrl(int cmd,int iarg,char *parg);*/
int /* Needed for libressl-portable. */
BIO_printf(BIO *bio, const char *format, ...) #ifndef __MINGW_PRINTF_FORMAT
int BIO_printf(BIO *bio, const char *format, ...)
__attribute__((__format__(__printf__, 2, 3), __nonnull__(2))); __attribute__((__format__(__printf__, 2, 3), __nonnull__(2)));
int int BIO_vprintf(BIO *bio, const char *format, va_list args)
BIO_vprintf(BIO *bio, const char *format, va_list args)
__attribute__((__format__(__printf__, 2, 0), __nonnull__(2))); __attribute__((__format__(__printf__, 2, 0), __nonnull__(2)));
int int BIO_snprintf(char *buf, size_t n, const char *format, ...)
BIO_snprintf(char *buf, size_t n, const char *format, ...)
__attribute__((__deprecated__, __format__(__printf__, 3, 4), __attribute__((__deprecated__, __format__(__printf__, 3, 4),
__nonnull__(3))); __nonnull__(3)));
int int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
__attribute__((__deprecated__, __format__(__printf__, 3, 0), __attribute__((__deprecated__, __format__(__printf__, 3, 0),
__nonnull__(3))); __nonnull__(3)));
#else
int BIO_printf(BIO *bio, const char *format, ...)
__attribute__((__format__(__MINGW_PRINTF_FORMAT, 2, 3), __nonnull__(2)));
int BIO_vprintf(BIO *bio, const char *format, va_list args)
__attribute__((__format__(__MINGW_PRINTF_FORMAT, 2, 0), __nonnull__(2)));
int BIO_snprintf(char *buf, size_t n, const char *format, ...)
__attribute__((__deprecated__, __format__(__MINGW_PRINTF_FORMAT, 3, 4),
__nonnull__(3)));
int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
__attribute__((__deprecated__, __format__(__MINGW_PRINTF_FORMAT, 3, 0),
__nonnull__(3)));
#endif
void ERR_load_BIO_strings(void); void ERR_load_BIO_strings(void);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: bio_cb.c,v 1.18 2022/01/07 09:02:17 tb Exp $ */ /* $OpenBSD: bio_cb.c,v 1.19 2023/07/05 21:23:37 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -153,3 +153,4 @@ BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi, long argl,
fputs(buf, stderr); fputs(buf, stderr);
return (r); return (r);
} }
LCRYPTO_ALIAS(BIO_debug_callback);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: bio_err.c,v 1.19 2022/07/12 14:42:48 kn Exp $ */ /* $OpenBSD: bio_err.c,v 1.20 2023/07/05 21:23:37 beck Exp $ */
/* ==================================================================== /* ====================================================================
* Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved.
* *
@ -117,3 +117,4 @@ ERR_load_BIO_strings(void)
} }
#endif #endif
} }
LCRYPTO_ALIAS(ERR_load_BIO_strings);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: bio_lib.c,v 1.44 2023/03/15 06:14:02 tb Exp $ */ /* $OpenBSD: bio_lib.c,v 1.45 2023/07/05 21:23:37 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved. * All rights reserved.
* *
@ -129,6 +129,7 @@ BIO_get_new_index(void)
return index; return index;
} }
LCRYPTO_ALIAS(BIO_get_new_index);
BIO * BIO *
BIO_new(const BIO_METHOD *method) BIO_new(const BIO_METHOD *method)
@ -147,6 +148,7 @@ BIO_new(const BIO_METHOD *method)
} }
return (ret); return (ret);
} }
LCRYPTO_ALIAS(BIO_new);
int int
BIO_set(BIO *bio, const BIO_METHOD *method) BIO_set(BIO *bio, const BIO_METHOD *method)
@ -176,6 +178,7 @@ BIO_set(BIO *bio, const BIO_METHOD *method)
} }
return (1); return (1);
} }
LCRYPTO_ALIAS(BIO_set);
int int
BIO_free(BIO *a) BIO_free(BIO *a)
@ -201,12 +204,14 @@ BIO_free(BIO *a)
free(a); free(a);
return (1); return (1);
} }
LCRYPTO_ALIAS(BIO_free);
void void
BIO_vfree(BIO *a) BIO_vfree(BIO *a)
{ {
BIO_free(a); BIO_free(a);
} }
LCRYPTO_ALIAS(BIO_vfree);
int int
BIO_up_ref(BIO *bio) BIO_up_ref(BIO *bio)
@ -214,108 +219,126 @@ BIO_up_ref(BIO *bio)
int refs = CRYPTO_add(&bio->references, 1, CRYPTO_LOCK_BIO); int refs = CRYPTO_add(&bio->references, 1, CRYPTO_LOCK_BIO);
return (refs > 1) ? 1 : 0; return (refs > 1) ? 1 : 0;
} }
LCRYPTO_ALIAS(BIO_up_ref);
void * void *
BIO_get_data(BIO *a) BIO_get_data(BIO *a)
{ {
return (a->ptr); return (a->ptr);
} }
LCRYPTO_ALIAS(BIO_get_data);
void void
BIO_set_data(BIO *a, void *ptr) BIO_set_data(BIO *a, void *ptr)
{ {
a->ptr = ptr; a->ptr = ptr;
} }
LCRYPTO_ALIAS(BIO_set_data);
int int
BIO_get_init(BIO *a) BIO_get_init(BIO *a)
{ {
return a->init; return a->init;
} }
LCRYPTO_ALIAS(BIO_get_init);
void void
BIO_set_init(BIO *a, int init) BIO_set_init(BIO *a, int init)
{ {
a->init = init; a->init = init;
} }
LCRYPTO_ALIAS(BIO_set_init);
int int
BIO_get_shutdown(BIO *a) BIO_get_shutdown(BIO *a)
{ {
return (a->shutdown); return (a->shutdown);
} }
LCRYPTO_ALIAS(BIO_get_shutdown);
void void
BIO_set_shutdown(BIO *a, int shut) BIO_set_shutdown(BIO *a, int shut)
{ {
a->shutdown = shut; a->shutdown = shut;
} }
LCRYPTO_ALIAS(BIO_set_shutdown);
void void
BIO_clear_flags(BIO *b, int flags) BIO_clear_flags(BIO *b, int flags)
{ {
b->flags &= ~flags; b->flags &= ~flags;
} }
LCRYPTO_ALIAS(BIO_clear_flags);
int int
BIO_test_flags(const BIO *b, int flags) BIO_test_flags(const BIO *b, int flags)
{ {
return (b->flags & flags); return (b->flags & flags);
} }
LCRYPTO_ALIAS(BIO_test_flags);
void void
BIO_set_flags(BIO *b, int flags) BIO_set_flags(BIO *b, int flags)
{ {
b->flags |= flags; b->flags |= flags;
} }
LCRYPTO_ALIAS(BIO_set_flags);
BIO_callback_fn BIO_callback_fn
BIO_get_callback(const BIO *b) BIO_get_callback(const BIO *b)
{ {
return b->callback; return b->callback;
} }
LCRYPTO_ALIAS(BIO_get_callback);
void void
BIO_set_callback(BIO *b, BIO_callback_fn cb) BIO_set_callback(BIO *b, BIO_callback_fn cb)
{ {
b->callback = cb; b->callback = cb;
} }
LCRYPTO_ALIAS(BIO_set_callback);
BIO_callback_fn_ex BIO_callback_fn_ex
BIO_get_callback_ex(const BIO *b) BIO_get_callback_ex(const BIO *b)
{ {
return b->callback_ex; return b->callback_ex;
} }
LCRYPTO_ALIAS(BIO_get_callback_ex);
void void
BIO_set_callback_ex(BIO *b, BIO_callback_fn_ex cb) BIO_set_callback_ex(BIO *b, BIO_callback_fn_ex cb)
{ {
b->callback_ex = cb; b->callback_ex = cb;
} }
LCRYPTO_ALIAS(BIO_set_callback_ex);
void void
BIO_set_callback_arg(BIO *b, char *arg) BIO_set_callback_arg(BIO *b, char *arg)
{ {
b->cb_arg = arg; b->cb_arg = arg;
} }
LCRYPTO_ALIAS(BIO_set_callback_arg);
char * char *
BIO_get_callback_arg(const BIO *b) BIO_get_callback_arg(const BIO *b)
{ {
return b->cb_arg; return b->cb_arg;
} }
LCRYPTO_ALIAS(BIO_get_callback_arg);
const char * const char *
BIO_method_name(const BIO *b) BIO_method_name(const BIO *b)
{ {
return b->method->name; return b->method->name;
} }
LCRYPTO_ALIAS(BIO_method_name);
int int
BIO_method_type(const BIO *b) BIO_method_type(const BIO *b)
{ {
return b->method->type; return b->method->type;
} }
LCRYPTO_ALIAS(BIO_method_type);
int int
BIO_read(BIO *b, void *out, int outl) BIO_read(BIO *b, void *out, int outl)
@ -373,6 +396,7 @@ BIO_read(BIO *b, void *out, int outl)
return (ret); return (ret);
} }
LCRYPTO_ALIAS(BIO_read);
int int
BIO_write(BIO *b, const void *in, int inl) BIO_write(BIO *b, const void *in, int inl)
@ -429,6 +453,7 @@ BIO_write(BIO *b, const void *in, int inl)
return (ret); return (ret);
} }
LCRYPTO_ALIAS(BIO_write);
int int
BIO_puts(BIO *b, const char *in) BIO_puts(BIO *b, const char *in)
@ -473,6 +498,7 @@ BIO_puts(BIO *b, const char *in)
return (ret); return (ret);
} }
LCRYPTO_ALIAS(BIO_puts);
int int
BIO_gets(BIO *b, char *in, int inl) BIO_gets(BIO *b, char *in, int inl)
@ -515,6 +541,7 @@ BIO_gets(BIO *b, char *in, int inl)
return (ret); return (ret);
} }
LCRYPTO_ALIAS(BIO_gets);
int int
BIO_indent(BIO *b, int indent, int max) BIO_indent(BIO *b, int indent, int max)
@ -528,6 +555,7 @@ BIO_indent(BIO *b, int indent, int max)
return 0; return 0;
return 1; return 1;
} }
LCRYPTO_ALIAS(BIO_indent);
long long
BIO_int_ctrl(BIO *b, int cmd, long larg, int iarg) BIO_int_ctrl(BIO *b, int cmd, long larg, int iarg)
@ -537,6 +565,7 @@ BIO_int_ctrl(BIO *b, int cmd, long larg, int iarg)
i = iarg; i = iarg;
return (BIO_ctrl(b, cmd, larg, (char *)&i)); return (BIO_ctrl(b, cmd, larg, (char *)&i));
} }
LCRYPTO_ALIAS(BIO_int_ctrl);
char * char *
BIO_ptr_ctrl(BIO *b, int cmd, long larg) BIO_ptr_ctrl(BIO *b, int cmd, long larg)
@ -548,6 +577,7 @@ BIO_ptr_ctrl(BIO *b, int cmd, long larg)
else else
return (p); return (p);
} }
LCRYPTO_ALIAS(BIO_ptr_ctrl);
long long
BIO_ctrl(BIO *b, int cmd, long larg, void *parg) BIO_ctrl(BIO *b, int cmd, long larg, void *parg)
@ -577,6 +607,7 @@ BIO_ctrl(BIO *b, int cmd, long larg, void *parg)
return (ret); return (ret);
} }
LCRYPTO_ALIAS(BIO_ctrl);
long long
BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp) BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
@ -607,6 +638,7 @@ BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
return (ret); return (ret);
} }
LCRYPTO_ALIAS(BIO_callback_ctrl);
/* It is unfortunate to duplicate in functions what the BIO_(w)pending macros /* It is unfortunate to duplicate in functions what the BIO_(w)pending macros
* do; but those macros have inappropriate return type, and for interfacing * do; but those macros have inappropriate return type, and for interfacing
@ -616,12 +648,14 @@ BIO_ctrl_pending(BIO *bio)
{ {
return BIO_ctrl(bio, BIO_CTRL_PENDING, 0, NULL); return BIO_ctrl(bio, BIO_CTRL_PENDING, 0, NULL);
} }
LCRYPTO_ALIAS(BIO_ctrl_pending);
size_t size_t
BIO_ctrl_wpending(BIO *bio) BIO_ctrl_wpending(BIO *bio)
{ {
return BIO_ctrl(bio, BIO_CTRL_WPENDING, 0, NULL); return BIO_ctrl(bio, BIO_CTRL_WPENDING, 0, NULL);
} }
LCRYPTO_ALIAS(BIO_ctrl_wpending);
/* /*
@ -649,6 +683,7 @@ BIO_push(BIO *b, BIO *bio)
BIO_ctrl(b, BIO_CTRL_PUSH, 0, lb); BIO_ctrl(b, BIO_CTRL_PUSH, 0, lb);
return (b); return (b);
} }
LCRYPTO_ALIAS(BIO_push);
/* Remove the first and return the rest */ /* Remove the first and return the rest */
BIO * BIO *
@ -671,6 +706,7 @@ BIO_pop(BIO *b)
b->prev_bio = NULL; b->prev_bio = NULL;
return (ret); return (ret);
} }
LCRYPTO_ALIAS(BIO_pop);
BIO * BIO *
BIO_get_retry_BIO(BIO *bio, int *reason) BIO_get_retry_BIO(BIO *bio, int *reason)
@ -690,18 +726,21 @@ BIO_get_retry_BIO(BIO *bio, int *reason)
*reason = last->retry_reason; *reason = last->retry_reason;
return (last); return (last);
} }
LCRYPTO_ALIAS(BIO_get_retry_BIO);
int int
BIO_get_retry_reason(BIO *bio) BIO_get_retry_reason(BIO *bio)
{ {
return (bio->retry_reason); return (bio->retry_reason);
} }
LCRYPTO_ALIAS(BIO_get_retry_reason);
void void
BIO_set_retry_reason(BIO *bio, int reason) BIO_set_retry_reason(BIO *bio, int reason)
{ {
bio->retry_reason = reason; bio->retry_reason = reason;
} }
LCRYPTO_ALIAS(BIO_set_retry_reason);
BIO * BIO *
BIO_find_type(BIO *bio, int type) BIO_find_type(BIO *bio, int type)
@ -724,6 +763,7 @@ BIO_find_type(BIO *bio, int type)
} while (bio != NULL); } while (bio != NULL);
return (NULL); return (NULL);
} }
LCRYPTO_ALIAS(BIO_find_type);
BIO * BIO *
BIO_next(BIO *b) BIO_next(BIO *b)
@ -732,6 +772,7 @@ BIO_next(BIO *b)
return NULL; return NULL;
return b->next_bio; return b->next_bio;
} }
LCRYPTO_ALIAS(BIO_next);
/* /*
* Two chains "bio -> oldtail" and "oldhead -> next" become * Two chains "bio -> oldtail" and "oldhead -> next" become
@ -753,6 +794,7 @@ BIO_set_next(BIO *bio, BIO *next)
if (next != NULL) if (next != NULL)
next->prev_bio = bio; next->prev_bio = bio;
} }
LCRYPTO_ALIAS(BIO_set_next);
void void
BIO_free_all(BIO *bio) BIO_free_all(BIO *bio)
@ -770,6 +812,7 @@ BIO_free_all(BIO *bio)
break; break;
} }
} }
LCRYPTO_ALIAS(BIO_free_all);
BIO * BIO *
BIO_dup_chain(BIO *in) BIO_dup_chain(BIO *in)
@ -813,6 +856,7 @@ err:
return (NULL); return (NULL);
} }
LCRYPTO_ALIAS(BIO_dup_chain);
void void
BIO_copy_next_retry(BIO *b) BIO_copy_next_retry(BIO *b)
@ -820,6 +864,7 @@ BIO_copy_next_retry(BIO *b)
BIO_set_flags(b, BIO_get_retry_flags(b->next_bio)); BIO_set_flags(b, BIO_get_retry_flags(b->next_bio));
b->retry_reason = b->next_bio->retry_reason; b->retry_reason = b->next_bio->retry_reason;
} }
LCRYPTO_ALIAS(BIO_copy_next_retry);
int int
BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
@ -828,18 +873,21 @@ BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_BIO, argl, argp, return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_BIO, argl, argp,
new_func, dup_func, free_func); new_func, dup_func, free_func);
} }
LCRYPTO_ALIAS(BIO_get_ex_new_index);
int int
BIO_set_ex_data(BIO *bio, int idx, void *data) BIO_set_ex_data(BIO *bio, int idx, void *data)
{ {
return (CRYPTO_set_ex_data(&(bio->ex_data), idx, data)); return (CRYPTO_set_ex_data(&(bio->ex_data), idx, data));
} }
LCRYPTO_ALIAS(BIO_set_ex_data);
void * void *
BIO_get_ex_data(BIO *bio, int idx) BIO_get_ex_data(BIO *bio, int idx)
{ {
return (CRYPTO_get_ex_data(&(bio->ex_data), idx)); return (CRYPTO_get_ex_data(&(bio->ex_data), idx));
} }
LCRYPTO_ALIAS(BIO_get_ex_data);
unsigned long unsigned long
BIO_number_read(BIO *bio) BIO_number_read(BIO *bio)
@ -848,6 +896,7 @@ BIO_number_read(BIO *bio)
return bio->num_read; return bio->num_read;
return 0; return 0;
} }
LCRYPTO_ALIAS(BIO_number_read);
unsigned long unsigned long
BIO_number_written(BIO *bio) BIO_number_written(BIO *bio)
@ -856,3 +905,4 @@ BIO_number_written(BIO *bio)
return bio->num_write; return bio->num_write;
return 0; return 0;
} }
LCRYPTO_ALIAS(BIO_number_written);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: bio_meth.c,v 1.8 2022/01/14 08:40:57 tb Exp $ */ /* $OpenBSD: bio_meth.c,v 1.9 2023/07/05 21:23:37 beck Exp $ */
/* /*
* Copyright (c) 2018 Theo Buehler <tb@openbsd.org> * Copyright (c) 2018 Theo Buehler <tb@openbsd.org>
* *
@ -34,18 +34,21 @@ BIO_meth_new(int type, const char *name)
return biom; return biom;
} }
LCRYPTO_ALIAS(BIO_meth_new);
void void
BIO_meth_free(BIO_METHOD *biom) BIO_meth_free(BIO_METHOD *biom)
{ {
free(biom); free(biom);
} }
LCRYPTO_ALIAS(BIO_meth_free);
int int
(*BIO_meth_get_write(const BIO_METHOD *biom))(BIO *, const char *, int) (*BIO_meth_get_write(const BIO_METHOD *biom))(BIO *, const char *, int)
{ {
return biom->bwrite; return biom->bwrite;
} }
LCRYPTO_ALIAS(BIO_meth_get_write);
int int
BIO_meth_set_write(BIO_METHOD *biom, int (*write)(BIO *, const char *, int)) BIO_meth_set_write(BIO_METHOD *biom, int (*write)(BIO *, const char *, int))
@ -53,12 +56,14 @@ BIO_meth_set_write(BIO_METHOD *biom, int (*write)(BIO *, const char *, int))
biom->bwrite = write; biom->bwrite = write;
return 1; return 1;
} }
LCRYPTO_ALIAS(BIO_meth_set_write);
int int
(*BIO_meth_get_read(const BIO_METHOD *biom))(BIO *, char *, int) (*BIO_meth_get_read(const BIO_METHOD *biom))(BIO *, char *, int)
{ {
return biom->bread; return biom->bread;
} }
LCRYPTO_ALIAS(BIO_meth_get_read);
int int
BIO_meth_set_read(BIO_METHOD *biom, int (*read)(BIO *, char *, int)) BIO_meth_set_read(BIO_METHOD *biom, int (*read)(BIO *, char *, int))
@ -66,12 +71,14 @@ BIO_meth_set_read(BIO_METHOD *biom, int (*read)(BIO *, char *, int))
biom->bread = read; biom->bread = read;
return 1; return 1;
} }
LCRYPTO_ALIAS(BIO_meth_set_read);
int int
(*BIO_meth_get_puts(const BIO_METHOD *biom))(BIO *, const char *) (*BIO_meth_get_puts(const BIO_METHOD *biom))(BIO *, const char *)
{ {
return biom->bputs; return biom->bputs;
} }
LCRYPTO_ALIAS(BIO_meth_get_puts);
int int
BIO_meth_set_puts(BIO_METHOD *biom, int (*puts)(BIO *, const char *)) BIO_meth_set_puts(BIO_METHOD *biom, int (*puts)(BIO *, const char *))
@ -79,12 +86,14 @@ BIO_meth_set_puts(BIO_METHOD *biom, int (*puts)(BIO *, const char *))
biom->bputs = puts; biom->bputs = puts;
return 1; return 1;
} }
LCRYPTO_ALIAS(BIO_meth_set_puts);
int int
(*BIO_meth_get_gets(const BIO_METHOD *biom))(BIO *, char *, int) (*BIO_meth_get_gets(const BIO_METHOD *biom))(BIO *, char *, int)
{ {
return biom->bgets; return biom->bgets;
} }
LCRYPTO_ALIAS(BIO_meth_get_gets);
int int
BIO_meth_set_gets(BIO_METHOD *biom, int (*gets)(BIO *, char *, int)) BIO_meth_set_gets(BIO_METHOD *biom, int (*gets)(BIO *, char *, int))
@ -92,12 +101,14 @@ BIO_meth_set_gets(BIO_METHOD *biom, int (*gets)(BIO *, char *, int))
biom->bgets = gets; biom->bgets = gets;
return 1; return 1;
} }
LCRYPTO_ALIAS(BIO_meth_set_gets);
long long
(*BIO_meth_get_ctrl(const BIO_METHOD *biom))(BIO *, int, long, void *) (*BIO_meth_get_ctrl(const BIO_METHOD *biom))(BIO *, int, long, void *)
{ {
return biom->ctrl; return biom->ctrl;
} }
LCRYPTO_ALIAS(BIO_meth_get_ctrl);
int int
BIO_meth_set_ctrl(BIO_METHOD *biom, long (*ctrl)(BIO *, int, long, void *)) BIO_meth_set_ctrl(BIO_METHOD *biom, long (*ctrl)(BIO *, int, long, void *))
@ -105,12 +116,14 @@ BIO_meth_set_ctrl(BIO_METHOD *biom, long (*ctrl)(BIO *, int, long, void *))
biom->ctrl = ctrl; biom->ctrl = ctrl;
return 1; return 1;
} }
LCRYPTO_ALIAS(BIO_meth_set_ctrl);
int int
(*BIO_meth_get_create(const BIO_METHOD *biom))(BIO *) (*BIO_meth_get_create(const BIO_METHOD *biom))(BIO *)
{ {
return biom->create; return biom->create;
} }
LCRYPTO_ALIAS(BIO_meth_get_create);
int int
BIO_meth_set_create(BIO_METHOD *biom, int (*create)(BIO *)) BIO_meth_set_create(BIO_METHOD *biom, int (*create)(BIO *))
@ -118,12 +131,14 @@ BIO_meth_set_create(BIO_METHOD *biom, int (*create)(BIO *))
biom->create = create; biom->create = create;
return 1; return 1;
} }
LCRYPTO_ALIAS(BIO_meth_set_create);
int int
(*BIO_meth_get_destroy(const BIO_METHOD *biom))(BIO *) (*BIO_meth_get_destroy(const BIO_METHOD *biom))(BIO *)
{ {
return biom->destroy; return biom->destroy;
} }
LCRYPTO_ALIAS(BIO_meth_get_destroy);
int int
BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy)(BIO *)) BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy)(BIO *))
@ -131,12 +146,14 @@ BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy)(BIO *))
biom->destroy = destroy; biom->destroy = destroy;
return 1; return 1;
} }
LCRYPTO_ALIAS(BIO_meth_set_destroy);
long long
(*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom))(BIO *, int, BIO_info_cb *) (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom))(BIO *, int, BIO_info_cb *)
{ {
return biom->callback_ctrl; return biom->callback_ctrl;
} }
LCRYPTO_ALIAS(BIO_meth_get_callback_ctrl);
int int
BIO_meth_set_callback_ctrl(BIO_METHOD *biom, BIO_meth_set_callback_ctrl(BIO_METHOD *biom,
@ -145,3 +162,4 @@ BIO_meth_set_callback_ctrl(BIO_METHOD *biom,
biom->callback_ctrl = callback_ctrl; biom->callback_ctrl = callback_ctrl;
return 1; return 1;
} }
LCRYPTO_ALIAS(BIO_meth_set_callback_ctrl);

Some files were not shown because too many files have changed in this diff Show more