Skip to content

Commit

Permalink
[depends] bump libssh to 0.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Rechi committed Aug 20, 2018
1 parent 63b2453 commit b4c3116
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 55 deletions.
6 changes: 3 additions & 3 deletions depends/common/libssh/01-removelegacy.patch
@@ -1,10 +1,10 @@
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -123,7 +123,6 @@
init.c
@@ -134,7 +134,6 @@
kex.c
known_hosts.c
knownhosts.c
- legacy.c
libcrypto.c
log.c
match.c
messages.c
10 changes: 5 additions & 5 deletions depends/common/libssh/02-build-static.patch
@@ -1,18 +1,18 @@
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -224,6 +224,7 @@
${LIBSSH_PRIVATE_INCLUDE_DIRS}
)
@@ -293,6 +293,7 @@
)
endif (WITH_SYMBOL_VERSIONING AND ABIMAP_FOUND)

+if(OFF)
add_library(${LIBSSH_SHARED_LIBRARY} SHARED ${libssh_SRCS})

target_link_libraries(${LIBSSH_SHARED_LIBRARY} ${LIBSSH_LINK_LIBRARIES})
@@ -258,6 +259,7 @@
@@ -338,6 +339,7 @@
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
COMPONENT libraries
)
+endif()

if (WITH_STATIC_LIB)
if (BUILD_STATIC_LIB)
add_library(${LIBSSH_STATIC_LIBRARY} STATIC ${libssh_SRCS})
71 changes: 41 additions & 30 deletions depends/common/libssh/03-md5.patch
@@ -1,7 +1,7 @@
--- a/include/libssh/wrapper.h
+++ b/include/libssh/wrapper.h
@@ -52,7 +52,7 @@
};
@@ -56,7 +56,7 @@
struct ssh_cipher_struct;

typedef struct ssh_mac_ctx_struct *ssh_mac_ctx;
-MD5CTX md5_init(void);
Expand All @@ -11,16 +11,16 @@

--- a/src/dh.c
+++ b/src/dh.c
@@ -918,7 +918,7 @@
return SSH_ERROR;
}
@@ -964,7 +964,7 @@
return SSH_ERROR;
}

- ctx = md5_init();
+ ctx = ssh_md5_init();
if (ctx == NULL) {
SAFE_FREE(h);
return SSH_ERROR;
@@ -1049,7 +1049,7 @@
- ctx = md5_init();
+ ctx = ssh_md5_init();
if (ctx == NULL) {
SAFE_FREE(h);
return SSH_ERROR;
@@ -1152,7 +1152,7 @@
goto out;
}

Expand All @@ -29,31 +29,20 @@
if (ctx == NULL) {
free(h);
rc = -1;
--- a/src/kex1.c
+++ b/src/kex1.c
@@ -78,7 +78,7 @@
ssh_string hostn) {
MD5CTX md5 = NULL;

- md5 = md5_init();
+ md5 = ssh_md5_init();
if (md5 == NULL) {
return -1;
}
--- a/src/libcrypto.c
+++ b/src/libcrypto.c
@@ -234,7 +234,7 @@
SHA512(digest, len, hash);
@@ -313,7 +313,7 @@
}
}

-MD5CTX md5_init(void) {
+MD5CTX ssh_md5_init(void) {
MD5CTX c = malloc(sizeof(*c));
if (c == NULL) {
return NULL;
-MD5CTX md5_init(void)
+MD5CTX ssh_md5_init(void)
{
int rc;
MD5CTX c = EVP_MD_CTX_create();
--- a/src/libgcrypt.c
+++ b/src/libgcrypt.c
@@ -132,7 +132,7 @@
@@ -202,7 +202,7 @@
gcry_md_hash_buffer(GCRY_MD_SHA512, hash, digest, len);
}

Expand All @@ -62,3 +51,25 @@
MD5CTX c = NULL;
gcry_md_open(&c, GCRY_MD_MD5, 0);

--- a/src/libmbedcrypto.c
+++ b/src/libmbedcrypto.c
@@ -335,7 +335,7 @@
}
}

-MD5CTX md5_init(void)
+MD5CTX ssh_md5_init(void)
{
MD5CTX ctx = NULL;
int rc;
--- a/src/pki_gcrypt.c
+++ b/src/pki_gcrypt.c
@@ -255,7 +255,7 @@
unsigned int md_not_empty;

for (j = 0, md_not_empty = 0; j < keylen; ) {
- md = md5_init();
+ md = ssh_md5_init();
if (md == NULL) {
return -1;
}
8 changes: 4 additions & 4 deletions depends/common/libssh/05-android.patch
@@ -1,6 +1,6 @@
--- a/src/misc.c
+++ b/src/misc.c
@@ -208,6 +208,9 @@
@@ -215,6 +215,9 @@

char *ssh_get_user_home_dir(void) {
char *szPath = NULL;
Expand All @@ -10,15 +10,15 @@
struct passwd pwd;
struct passwd *pwdbuf;
char buf[NSS_BUFLEN_PASSWD];
@@ -226,6 +229,7 @@
@@ -233,6 +236,7 @@
}

szPath = strdup(pwd.pw_dir);
+#endif

return szPath;
}
@@ -240,6 +244,17 @@
@@ -247,6 +251,17 @@
}

char *ssh_get_local_username(void) {
Expand All @@ -36,7 +36,7 @@
struct passwd pwd;
struct passwd *pwdbuf;
char buf[NSS_BUFLEN_PASSWD];
@@ -253,6 +268,7 @@
@@ -260,6 +275,7 @@

name = strdup(pwd.pw_name);

Expand Down
12 changes: 11 additions & 1 deletion depends/common/libssh/06-windows.patch
Expand Up @@ -11,7 +11,7 @@
#endif /* _WIN32 */
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -265,7 +265,7 @@
@@ -345,7 +345,7 @@
add_library(${LIBSSH_STATIC_LIBRARY} STATIC ${libssh_SRCS})

if (MSVC)
Expand All @@ -20,3 +20,13 @@
else (MSVC)
set(OUTPUT_SUFFIX )
endif (MSVC)
--- a/src/sftp.c
+++ b/src/sftp.c
@@ -31,6 +31,7 @@
#include <fcntl.h>
#include <stdio.h>
#include <stdio.h>
+#include <stdint.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <limits.h>
20 changes: 10 additions & 10 deletions depends/common/libssh/07-windowsstore.patch
Expand Up @@ -28,7 +28,7 @@

--- a/src/external/fe25519.c
+++ b/src/external/fe25519.c
@@ -85,7 +85,14 @@
@@ -87,7 +87,14 @@
}
m &= ge(r->v[0],237);

Expand All @@ -43,7 +43,7 @@

r->v[31] -= m&127;
for (i = 30; i > 0; i--) {
@@ -157,7 +164,14 @@
@@ -159,7 +166,14 @@
int i;
uint32_t mask = b;

Expand All @@ -60,8 +60,8 @@
r->v[i] ^= mask & (x->v[i] ^ r->v[i]);
--- a/src/misc.c
+++ b/src/misc.c
@@ -49,6 +49,10 @@
#include <time.h>
@@ -50,6 +50,10 @@


#ifdef _WIN32
+#if !defined(WIN32_LEAN_AND_MEAN)
Expand All @@ -71,31 +71,31 @@

#ifndef _WIN32_IE
# define _WIN32_IE 0x0501 // SHGetSpecialFolderPath
@@ -98,6 +102,7 @@
@@ -105,6 +109,7 @@

#ifdef _WIN32
char *ssh_get_user_home_dir(void) {
+#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_APP)
char tmp[MAX_PATH] = {0};
char *szPath = NULL;

@@ -110,6 +115,7 @@
@@ -117,6 +122,7 @@
strcpy(szPath, tmp);
return szPath;
}
+#endif

return NULL;
}
@@ -140,6 +146,7 @@
@@ -147,6 +153,7 @@
}

char *ssh_get_local_username(void) {
+#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_APP)
DWORD size = 0;
char *user;

@@ -154,6 +161,7 @@
@@ -161,6 +168,7 @@
if (GetUserName(user, &size)) {
return user;
}
Expand All @@ -105,7 +105,7 @@
}
--- a/src/options.c
+++ b/src/options.c
@@ -1402,7 +1402,7 @@
@@ -1455,7 +1455,7 @@
int key_type;
ssh_key key;
ssh_key *bind_key_loc = NULL;
Expand All @@ -116,7 +116,7 @@
if (rc != SSH_OK) {
--- a/src/pki_container_openssh.c
+++ b/src/pki_container_openssh.c
@@ -158,7 +158,7 @@
@@ -160,7 +160,7 @@
char passphrase_buffer[128];
size_t key_material_len;
ssh_buffer buffer;
Expand Down
27 changes: 27 additions & 0 deletions depends/common/libssh/08-openssl-1.0.patch
@@ -0,0 +1,27 @@
--- a/src/libcrypto-compat.c
+++ b/src/libcrypto-compat.c
@@ -319,7 +319,7 @@
return 1;
}

-#ifndef HAVE_OPENSSL_EVP_CIPHER_CTX_NEW
+#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x009080bfL
EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void)
{
return OPENSSL_zalloc(sizeof(EVP_CIPHER_CTX));
--- a/src/libcrypto.c
+++ b/src/libcrypto.c
@@ -630,11 +630,11 @@
* Same for num, which is being used to store the current offset in blocksize in CTR
* function.
*/
-#ifdef HAVE_OPENSSL_CRYPTO_CTR128_ENCRYPT
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
CRYPTO_ctr128_encrypt(in, out, len, &cipher->aes_key->key, cipher->aes_key->IV, tmp_buffer, &num, (block128_f)AES_encrypt);
#else
AES_ctr128_encrypt(in, out, len, &cipher->aes_key->key, cipher->aes_key->IV, tmp_buffer, &num);
-#endif /* HAVE_OPENSSL_CRYPTO_CTR128_ENCRYPT */
+#endif /* OPENSSL_VERSION_NUMBER >= 0x10100000L */
}

static void aes_ctr_cleanup(struct ssh_cipher_struct *cipher){
2 changes: 1 addition & 1 deletion depends/common/libssh/libssh.sha256
@@ -1 +1 @@
54e86dd5dc20e5367e58f3caab337ce37675f863f80df85b6b1614966a337095
d17f1267b4a5e46c0fbe66d39a3e702b8cefe788928f2eb6e339a18bb00b1924
2 changes: 1 addition & 1 deletion depends/common/libssh/libssh.txt
@@ -1 +1 @@
libssh http://mirrors.kodi.tv/build-deps/sources/libssh-0.7.5.tar.xz
libssh http://mirrors.kodi.tv/build-deps/sources/libssh-0.8.1.tar.xz

0 comments on commit b4c3116

Please sign in to comment.