add b64_ntop checking and fallback for nc(1)

This commit is contained in:
Brent Cook
2015-10-01 07:40:26 -05:00
parent 497a47c5fc
commit a7f031ba55
8 changed files with 366 additions and 7 deletions

View File

@@ -11,6 +11,7 @@ noinst_HEADERS += compat/err.h
noinst_HEADERS += compat/netdb.h
noinst_HEADERS += compat/poll.h
noinst_HEADERS += compat/readpassphrase.h
noinst_HEADERS += compat/resolv.h
noinst_HEADERS += compat/stdio.h
noinst_HEADERS += compat/stdlib.h
noinst_HEADERS += compat/string.h

View File

@@ -37,11 +37,7 @@
#define RPP_SEVENBIT 0x10 /* Strip the high bit from input. */
#define RPP_STDIN 0x20 /* Read from stdin, not /dev/tty */
#include <sys/cdefs.h>
__BEGIN_DECLS
char * readpassphrase(const char *, char *, size_t, int);
__END_DECLS
#endif /* !_READPASSPHRASE_H_ */

24
include/compat/resolv.h Normal file
View File

@@ -0,0 +1,24 @@
/*
* Public domain
* resolv.h compatibility shim
*/
#ifndef LIBCRYPTOCOMPAT_RESOLV_H
#define LIBCRYPTOCOMPAT_RESOLV_H
#ifdef _MSC_VER
#if _MSC_VER >= 1900
#include <../ucrt/resolv.h>
#else
#include <../include/resolv.h>
#endif
#else
#include_next <resolv.h>
#endif
#ifndef HAVE_B64_NTOP
int b64_ntop(unsigned char const *, size_t, char *, size_t);
int b64_pton(char const *, unsigned char *, size_t);
#endif
#endif