diff --git a/Makefile.am b/Makefile.am index ad579fe2..dfb03e65 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,7 +29,7 @@ OS400FILES = os400/README400 os400/initscript.sh os400/make.sh \ os400/config400.default \ os400/os400sys.c os400/ccsid.c \ os400/libssh2_config.h os400/macros.h os400/libssh2_ccsid.h \ - os400/include/alloca.h os400/include/sys/socket.h os400/include/stdio.h \ + os400/include/alloca.h os400/include/sys/socket.h \ os400/include/assert.h \ os400/libssh2rpg/libssh2.rpgle.in \ os400/libssh2rpg/libssh2_ccsid.rpgle.in \ diff --git a/os400/README400 b/os400/README400 index acb1eb7e..025cec79 100644 --- a/os400/README400 +++ b/os400/README400 @@ -18,7 +18,8 @@ additional procedures are provided for string transcoding (see below). No wrappers to standard procedures are provided: however, nested calls to transcoding procedures may be used. -Crypto API is provided by the IBM QC3 API library. It supports RSA, but not DSA. +Crypto API is provided by the IBM QC3 API library. It supports RSA and EC, +but not DSA. Standard compilation environment does support neither autotools nor make; @@ -36,7 +37,8 @@ Compiling on OS/400: archive extraction. Do not ask questions about these subjects if you're not familiar with. -_ As a prerequisite, QADRT development environment must be installed. +_ As a prerequisite, QADRT development environment >= 20211112 must be + installed. For more information on downloading and installing the QADRT development kit, please see https://www.ibm.com/support/pages/node/6258183 _ If data compression has to be supported, ZLIB development environment must diff --git a/os400/include/alloca.h b/os400/include/alloca.h index 4050fa84..050f4422 100644 --- a/os400/include/alloca.h +++ b/os400/include/alloca.h @@ -1,5 +1,5 @@ /* - * Copyright (C) Patrick Monnerat, D+H + * Copyright (C) Patrick Monnerat * All rights reserved. * * Redistribution and use in source and binary forms, diff --git a/os400/include/stdio.h b/os400/include/stdio.h deleted file mode 100644 index 79f26af6..00000000 --- a/os400/include/stdio.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) Patrick Monnerat, D+H - * All rights reserved. - * - * Redistribution and use in source and binary forms, - * with or without modification, are permitted provided - * that the following conditions are met: - * - * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * - * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * Neither the name of the copyright holder nor the names - * of any other contributors may be used to endorse or - * promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef LIBSSH2_STDIO_H -#define LIBSSH2_STDIO_H - -/* - * wrapper. - * Its goal is to redefine snprintf/vsnprintf which are not supported by QADRT. - */ - -#include - -#if __ILEC400_TGTVRM__ >= 710 -# include_next -#elif __ILEC400_TGTVRM__ >= 510 -# ifndef __SRCSTMF__ -# include -# else -# include -# endif -#endif - -extern int _libssh2_os400_vsnprintf(char *dst, size_t len, - const char *fmt, va_list args); -extern int _libssh2_os400_snprintf(char *dst, size_t len, - const char *fmt, ...); - -#ifndef LIBSSH2_DISABLE_QADRT_EXT -# define vsnprintf(dst, len, fmt, args) \ - _libssh2_os400_vsnprintf((dst), (len), (fmt), (args)) -# define snprintf _libssh2_os400_snprintf -#endif - -#endif - -/* vim: set expandtab ts=4 sw=4: */ diff --git a/os400/include/sys/socket.h b/os400/include/sys/socket.h index dbb3f33c..7d5adea9 100644 --- a/os400/include/sys/socket.h +++ b/os400/include/sys/socket.h @@ -1,5 +1,5 @@ /* - * Copyright (C) Patrick Monnerat, D+H + * Copyright (C) Patrick Monnerat * All rights reserved. * * Redistribution and use in source and binary forms, diff --git a/os400/libssh2_ccsid.h b/os400/libssh2_ccsid.h index bf2178eb..7bd080c2 100644 --- a/os400/libssh2_ccsid.h +++ b/os400/libssh2_ccsid.h @@ -1,5 +1,5 @@ /* - * Copyright (C) Patrick Monnerat, D+H + * Copyright (C) Patrick Monnerat * All rights reserved. * * Redistribution and use in source and binary forms, diff --git a/os400/libssh2_config.h b/os400/libssh2_config.h index d7943ce5..594a23c1 100644 --- a/os400/libssh2_config.h +++ b/os400/libssh2_config.h @@ -1,5 +1,5 @@ /* - * Copyright (C) Patrick Monnerat, D+H + * Copyright (C) Patrick Monnerat * All rights reserved. * * Redistribution and use in source and binary forms, diff --git a/os400/libssh2rpg/libssh2_ccsid.rpgle.in b/os400/libssh2rpg/libssh2_ccsid.rpgle.in index 37d3f12e..11364a7d 100644 --- a/os400/libssh2rpg/libssh2_ccsid.rpgle.in +++ b/os400/libssh2rpg/libssh2_ccsid.rpgle.in @@ -1,4 +1,4 @@ - * Copyright (C) Patrick Monnerat, D+H + * Copyright (C) Patrick Monnerat * All rights reserved. * * Redistribution and use in source and binary forms, diff --git a/os400/libssh2rpg/libssh2_publickey.rpgle b/os400/libssh2rpg/libssh2_publickey.rpgle index b900dbe2..4aabfbab 100644 --- a/os400/libssh2rpg/libssh2_publickey.rpgle +++ b/os400/libssh2rpg/libssh2_publickey.rpgle @@ -1,4 +1,4 @@ - * Copyright (C) Patrick Monnerat, D+H + * Copyright (C) Patrick Monnerat * All rights reserved. * * Redistribution and use in source and binary forms, diff --git a/os400/os400sys.c b/os400/os400sys.c index e0ce568b..081a26ef 100644 --- a/os400/os400sys.c +++ b/os400/os400sys.c @@ -1,5 +1,5 @@ /* - * Copyright (C) Patrick Monnerat, D+H + * Copyright (C) Patrick Monnerat * All rights reserved. * * Redistribution and use in source and binary forms, @@ -128,58 +128,6 @@ _libssh2_os400_connect(int sd, struct sockaddr *destaddr, int addrlen) } -int -_libssh2_os400_vsnprintf(char *dst, size_t len, const char *fmt, va_list args) -{ - size_t l = 4096; - int i; - char *buf; - - if(!dst || !len) { - errno = EINVAL; - return -1; - } - - if(l < len) - l = len; - - buf = alloca(l); - - if(!buf) { - errno = ENOMEM; - return -1; - } - - /* !checksrc! disable BANNEDFUNC 1 */ /* FIXME */ - i = vsprintf(buf, fmt, args); - - if(i < 0) - return i; - - if(--len > i) - len = i; - - if(len) - memcpy(dst, buf, len); - - dst[len] = '\0'; - return len; -} - -/* VARARGS3 */ -int -_libssh2_os400_snprintf(char *dst, size_t len, const char *fmt, ...) -{ - va_list args; - int ret; - - va_start(args, fmt); - ret = _libssh2_os400_vsnprintf(dst, len, fmt, args); - va_end(args); - return ret; -} - - #ifdef LIBSSH2_HAVE_ZLIB int _libssh2_os400_inflateInit_(z_streamp strm,