Index | Thread | Search

From:
Walter Alejandro Iglesias <wai@roquesor.com>
Subject:
Re: base64 encoder in libc
To:
tech@openbsd.org
Date:
Mon, 12 Aug 2024 12:46:13 +0200

Download raw body.

Thread
On Mon, Aug 12, 2024 at 10:38:08AM +0200, Walter Alejandro Iglesias wrote:
> I found out that there is a base64 encoder in libc (used by OpenSMTPD, by
> the way), which seems to be undocumented (at least I couldn't find a man
> page).
> 

And, as I should've guessed, replacing my hand written function for this
libc version was one more step towards non-portability.  Compiling my
test program under Linux I get this error:

  encode-word/encode-word.c:163: undefined reference to `__b64_ntop'

I see that the OpenSMTPD portable version on github includes this file
to make this work:

  openbsd-compat/base64.c

Another detail that worries me is that __b64_ntop definition has a
"DEPRECATED" flag:

In "src/lib/libc/hidden/resolv.h":

  PROTO_STD_DEPRECATED(__b64_ntop);