summaryrefslogtreecommitdiff
path: root/net-libs/libssh2/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-12-15 18:09:03 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-12-15 18:09:03 +0000
commit7bc9c63c9da678a7e6fceb095d56c634afd22c56 (patch)
tree4a67d50a439e9af63947e5f8b6ba3719af98b6c9 /net-libs/libssh2/files
parentb284a3168fa91a038925d2ecf5e4791011ea5e7d (diff)
gentoo resync : 15.12.2019
Diffstat (limited to 'net-libs/libssh2/files')
-rw-r--r--net-libs/libssh2/files/libssh2-1.9.0-missing.patch181
1 files changed, 0 insertions, 181 deletions
diff --git a/net-libs/libssh2/files/libssh2-1.9.0-missing.patch b/net-libs/libssh2/files/libssh2-1.9.0-missing.patch
deleted file mode 100644
index 7cc58d239638..000000000000
--- a/net-libs/libssh2/files/libssh2-1.9.0-missing.patch
+++ /dev/null
@@ -1,181 +0,0 @@
---- /dev/null
-+++ b/tests/test_public_key_auth_succeeds_with_correct_ed25519_key.c
-@@ -0,0 +1,37 @@
-+#include "session_fixture.h"
-+
-+#include <libssh2.h>
-+
-+#include <stdio.h>
-+
-+static const char *USERNAME = "libssh2"; /* configured in Dockerfile */
-+static const char *KEY_FILE_PRIVATE = "key_ed25519";
-+static const char *KEY_FILE_PUBLIC = "key_ed25519.pub"; /* configured in Dockerfile */
-+
-+int test(LIBSSH2_SESSION *session)
-+{
-+ int rc;
-+ const char *userauth_list = NULL;
-+
-+ userauth_list = libssh2_userauth_list(session, USERNAME, strlen(USERNAME));
-+ if(userauth_list == NULL) {
-+ print_last_session_error("libssh2_userauth_list");
-+ return 1;
-+ }
-+
-+ if(strstr(userauth_list, "publickey") == NULL) {
-+ fprintf(stderr, "'publickey' was expected in userauth list: %s\n",
-+ userauth_list);
-+ return 1;
-+ }
-+
-+ rc = libssh2_userauth_publickey_fromfile_ex(
-+ session, USERNAME, strlen(USERNAME), KEY_FILE_PUBLIC, KEY_FILE_PRIVATE,
-+ NULL);
-+ if(rc != 0) {
-+ print_last_session_error("libssh2_userauth_publickey_fromfile_ex");
-+ return 1;
-+ }
-+
-+ return 0;
-+}
---- /dev/null
-+++ b/tests/test_public_key_auth_succeeds_with_correct_encrypted_ed25519_key.c
-@@ -0,0 +1,38 @@
-+#include "session_fixture.h"
-+
-+#include <libssh2.h>
-+
-+#include <stdio.h>
-+
-+static const char *USERNAME = "libssh2"; /* configured in Dockerfile */
-+static const char *PASSWORD = "libssh2";
-+static const char *KEY_FILE_PRIVATE = "key_ed25519_encrypted";
-+static const char *KEY_FILE_PUBLIC = "key_ed25519_encrypted.pub"; /* configured in Dockerfile */
-+
-+int test(LIBSSH2_SESSION *session)
-+{
-+ int rc;
-+ const char *userauth_list = NULL;
-+
-+ userauth_list = libssh2_userauth_list(session, USERNAME, strlen(USERNAME));
-+ if(userauth_list == NULL) {
-+ print_last_session_error("libssh2_userauth_list");
-+ return 1;
-+ }
-+
-+ if(strstr(userauth_list, "publickey") == NULL) {
-+ fprintf(stderr, "'publickey' was expected in userauth list: %s\n",
-+ userauth_list);
-+ return 1;
-+ }
-+
-+ rc = libssh2_userauth_publickey_fromfile_ex(
-+ session, USERNAME, strlen(USERNAME), KEY_FILE_PUBLIC, KEY_FILE_PRIVATE,
-+ PASSWORD);
-+ if(rc != 0) {
-+ print_last_session_error("libssh2_userauth_publickey_fromfile_ex");
-+ return 1;
-+ }
-+
-+ return 0;
-+}
---- /dev/null
-+++ b/tests/test_public_key_auth_succeeds_with_correct_ed25519_key_from_mem.c
-@@ -0,0 +1,97 @@
-+#include "session_fixture.h"
-+
-+#include <libssh2.h>
-+
-+#include <stdio.h>
-+#include <stdlib.h>
-+
-+static const char *USERNAME = "libssh2"; /* configured in Dockerfile */
-+static const char *KEY_FILE_ED25519_PRIVATE = "key_ed25519";
-+
-+int read_file(const char *path, char **buf, size_t *len);
-+
-+int test(LIBSSH2_SESSION *session)
-+{
-+ int rc;
-+ FILE *fp = NULL;
-+ char *buffer = NULL;
-+ size_t len = 0;
-+ const char *userauth_list = NULL;
-+
-+ userauth_list = libssh2_userauth_list(session, USERNAME, strlen(USERNAME));
-+ if(userauth_list == NULL) {
-+ print_last_session_error("libssh2_userauth_list");
-+ return 1;
-+ }
-+
-+ if(strstr(userauth_list, "publickey") == NULL) {
-+ fprintf(stderr, "'publickey' was expected in userauth list: %s\n",
-+ userauth_list);
-+ return 1;
-+ }
-+
-+ if(read_file(KEY_FILE_ED25519_PRIVATE, &buffer, &len)) {
-+ fprintf(stderr, "Reading key file failed.");
-+ return 1;
-+ }
-+
-+ rc = libssh2_userauth_publickey_frommemory(session, USERNAME, strlen(USERNAME),
-+ NULL, 0, buffer, len, NULL);
-+
-+ free(buffer);
-+
-+ if(rc != 0) {
-+ print_last_session_error("libssh2_userauth_publickey_fromfile_ex");
-+ return 1;
-+ }
-+
-+ return 0;
-+}
-+
-+int read_file(const char *path, char **out_buffer, size_t *out_len)
-+{
-+ int rc;
-+ FILE *fp = NULL;
-+ char *buffer = NULL;
-+ size_t len = 0;
-+
-+ if(out_buffer == NULL || out_len == NULL || path == NULL) {
-+ fprintf(stderr, "invalid params.");
-+ return 1;
-+ }
-+
-+ *out_buffer = NULL;
-+ *out_len = 0;
-+
-+ fp = fopen(path, "r");
-+
-+ if(!fp) {
-+ fprintf(stderr, "File could not be read.");
-+ return 1;
-+ }
-+
-+ fseek(fp, 0L, SEEK_END);
-+ len = ftell(fp);
-+ rewind(fp);
-+
-+ buffer = calloc(1, len + 1);
-+ if(!buffer) {
-+ fclose(fp);
-+ fprintf(stderr, "Could not alloc memory.");
-+ return 1;
-+ }
-+
-+ if(1 != fread(buffer, len, 1, fp)) {
-+ fclose(fp);
-+ free(buffer);
-+ fprintf(stderr, "Could not read file into memory.");
-+ return 1;
-+ }
-+
-+ fclose(fp);
-+
-+ *out_buffer = buffer;
-+ *out_len = len;
-+
-+ return 0;
-+}