11/* Copyright (c) 2004-2009, Sara Golemon <sarag@libssh2.org>
2- * Copyright (c) 2009-2015 Daniel Stenberg
2+ * Copyright (c) 2009-2021 Daniel Stenberg
33 * Copyright (c) 2010 Simon Josefsson <simon@josefsson.org>
44 * All rights reserved.
55 *
4040#ifndef LIBSSH2_H
4141#define LIBSSH2_H 1
4242
43- #define LIBSSH2_COPYRIGHT "2004-2019 The libssh2 project and its contributors."
43+ #define LIBSSH2_COPYRIGHT "2004-2021 The libssh2 project and its contributors."
4444
4545/* We use underscore instead of dash when appending DEV in dev versions just
4646 to make the BANNER define (used by src/session.c) be a valid SSH
4747 banner. Release versions have no appended strings and may of course not
4848 have dashes either. */
49- #define LIBSSH2_VERSION "1.10.0 "
49+ #define LIBSSH2_VERSION "1.10.1_DEV "
5050
5151/* The numeric version number is also available "in parts" by using these
5252 defines: */
53- #define LIBSSH2_VERSION_MAJOR 1
54- #define LIBSSH2_VERSION_MINOR 10
55- #define LIBSSH2_VERSION_PATCH 0
53+ #define LIBSSH2_VERSION_MAJOR 1
54+ #define LIBSSH2_VERSION_MINOR 10
55+ #define LIBSSH2_VERSION_PATCH 1
5656
5757/* This is the numeric version of the libssh2 version number, meant for easier
5858 parsing and comparions by programs. The LIBSSH2_VERSION_NUM define will
6969 and it is always a greater number in a more recent release. It makes
7070 comparisons with greater than and less than work.
7171*/
72- #define LIBSSH2_VERSION_NUM 0x010a00
72+ #define LIBSSH2_VERSION_NUM 0x010a01
7373
7474/*
7575 * This is the date and time when the full source package was created. The
8080 *
8181 * "Mon Feb 12 11:35:33 UTC 2007"
8282 */
83- #define LIBSSH2_TIMESTAMP "Sun 29 Aug 2021 08:37:50 PM UTC "
83+ #define LIBSSH2_TIMESTAMP "DEV "
8484
8585#ifndef RC_INVOKED
8686
@@ -100,7 +100,7 @@ extern "C" {
100100/* Allow alternate API prefix from CFLAGS or calling app */
101101#ifndef LIBSSH2_API
102102# ifdef LIBSSH2_WIN32
103- # ifdef _WINDLL
103+ # if defined( _WINDLL ) || defined( libssh2_EXPORTS )
104104# ifdef LIBSSH2_LIBRARY
105105# define LIBSSH2_API __declspec(dllexport)
106106# else
@@ -272,8 +272,8 @@ typedef off_t libssh2_struct_stat_size;
272272
273273typedef struct _LIBSSH2_USERAUTH_KBDINT_PROMPT
274274{
275- char * text ;
276- unsigned int length ;
275+ unsigned char * text ;
276+ size_t length ;
277277 unsigned char echo ;
278278} LIBSSH2_USERAUTH_KBDINT_PROMPT ;
279279
@@ -356,6 +356,7 @@ typedef struct _LIBSSH2_USERAUTH_KBDINT_RESPONSE
356356#define LIBSSH2_METHOD_COMP_SC 7
357357#define LIBSSH2_METHOD_LANG_CS 8
358358#define LIBSSH2_METHOD_LANG_SC 9
359+ #define LIBSSH2_METHOD_SIGN_ALGO 10
359360
360361/* flags */
361362#define LIBSSH2_FLAG_SIGPIPE 1
@@ -506,6 +507,8 @@ typedef struct _LIBSSH2_POLLFD {
506507#define LIBSSH2_ERROR_CHANNEL_WINDOW_FULL -47
507508#define LIBSSH2_ERROR_KEYFILE_AUTH_FAILED -48
508509#define LIBSSH2_ERROR_RANDGEN -49
510+ #define LIBSSH2_ERROR_MISSING_USERAUTH_BANNER -50
511+ #define LIBSSH2_ERROR_ALGO_UNSUPPORTED -51
509512
510513/* this is a define to provide the old (<= 1.2.7) name */
511514#define LIBSSH2_ERROR_BANNER_NONE LIBSSH2_ERROR_BANNER_RECV
@@ -614,6 +617,8 @@ LIBSSH2_API const char *libssh2_session_banner_get(LIBSSH2_SESSION *session);
614617LIBSSH2_API char * libssh2_userauth_list (LIBSSH2_SESSION * session ,
615618 const char * username ,
616619 unsigned int username_len );
620+ LIBSSH2_API int libssh2_userauth_banner (LIBSSH2_SESSION * session ,
621+ char * * banner );
617622LIBSSH2_API int libssh2_userauth_authenticated (LIBSSH2_SESSION * session );
618623
619624LIBSSH2_API int
@@ -939,8 +944,21 @@ LIBSSH2_API int libssh2_base64_decode(LIBSSH2_SESSION *session, char **dest,
939944LIBSSH2_API
940945const char * libssh2_version (int req_version_num );
941946
947+ typedef enum {
948+ libssh2_no_crypto = 0 ,
949+ libssh2_openssl ,
950+ libssh2_gcrypt ,
951+ libssh2_mbedtls ,
952+ libssh2_wincng
953+ } libssh2_crypto_engine_t ;
954+
955+ LIBSSH2_API
956+ libssh2_crypto_engine_t libssh2_crypto_engine (void );
957+
942958#define HAVE_LIBSSH2_KNOWNHOST_API 0x010101 /* since 1.1.1 */
943959#define HAVE_LIBSSH2_VERSION_API 0x010100 /* libssh2_version since 1.1 */
960+ #define HAVE_LIBSSH2_CRYPTOENGINE_API 0x011100 /* libssh2_crypto_engine
961+ since 1.11 */
944962
945963struct libssh2_knownhost {
946964 unsigned int magic ; /* magic stored by the library */
0 commit comments