Remove libssh

libssh is LGPL licensed, which means I would need to re-license the
entire app since we are linking against it statically. I could
dynamically link against it, but since I was only trying to use it for
key-generation and that doesn' seem to be working, I may as well discard
it.

For now, I'm going to stick with jsch for the key generation. On ios
side, I'm not sure what I will do. One option could be to compile
openssh and call the ssh-keygen binary.
This commit is contained in:
Vishesh Handa
2019-05-16 17:29:56 +02:00
parent 17e1880c37
commit 62c99db1be
3 changed files with 7 additions and 11 deletions

View File

@ -22,14 +22,6 @@ set_target_properties(crypto-lib
PROPERTIES IMPORTED_LOCATION PROPERTIES IMPORTED_LOCATION
${lib_src_DIR}/lib/libcrypto.a) ${lib_src_DIR}/lib/libcrypto.a)
add_library(ssh-lib
STATIC
IMPORTED)
set_target_properties(ssh-lib
PROPERTIES IMPORTED_LOCATION
${lib_src_DIR}/lib/libssh.a)
add_library(ssh2-lib add_library(ssh2-lib
STATIC STATIC
IMPORTED) IMPORTED)
@ -55,4 +47,4 @@ add_library(native-lib
# The order of these libraries is super dooper important # The order of these libraries is super dooper important
# Otherwise you'll get linker errors # Otherwise you'll get linker errors
target_link_libraries(native-lib git2-lib ssh2-lib ssh-lib openssl-lib crypto-lib android log) target_link_libraries(native-lib git2-lib ssh2-lib openssl-lib crypto-lib android log)

View File

@ -1,4 +1,4 @@
CC=clang CC=clang
test: gitjournal.c test.c keygen.c test: gitjournal.c test.c keygen.c
$(CC) -o test -g test.c gitjournal.c keygen.c -lgit2 -lssh $(CC) -o test -g test.c gitjournal.c keygen.c -lgit2

View File

@ -4,9 +4,10 @@
#include <string.h> #include <string.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <git2.h> /*
#include <libssh/libssh.h> #include <libssh/libssh.h>
#include <libssh/callbacks.h> #include <libssh/callbacks.h>
*/
void change_pubickey_comment(const char *filename, const char *comment) void change_pubickey_comment(const char *filename, const char *comment)
{ {
@ -40,6 +41,8 @@ void gj_ssh_log_callback(int priority, const char *function, const char *buffer,
int gj_generate_ssh_keys(const char *private_key_path, int gj_generate_ssh_keys(const char *private_key_path,
const char *public_key_path, const char *comment) const char *public_key_path, const char *comment)
{ {
return 1;
/*
ssh_key key; ssh_key key;
int err; int err;
@ -79,4 +82,5 @@ int gj_generate_ssh_keys(const char *private_key_path,
chmod(private_key_path, modeInt); chmod(private_key_path, modeInt);
return 0; return 0;
*/
} }