aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2005-10-25 23:11:41 +0000
committerAris Adamantiadis <aris@0xbadc0de.be>2005-10-25 23:11:41 +0000
commit9a2683f183338da7c82261d502cdeff0855c210c (patch)
tree7a3f8ba8b1b754a1dd49c28bd175403d96d6ec2d /libssh
parentd86f0017545f0076a1136b5c6f8b0a7a58366342 (diff)
downloadlibssh-9a2683f183338da7c82261d502cdeff0855c210c.tar.gz
libssh-9a2683f183338da7c82261d502cdeff0855c210c.tar.xz
libssh-9a2683f183338da7c82261d502cdeff0855c210c.zip
added Jean-Philippe's patch for libtools. it doesn't compile on my computer.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@40 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh')
-rw-r--r--libssh/Makefile.in29
-rw-r--r--libssh/kex.c19
-rw-r--r--libssh/libssh.vers59
3 files changed, 93 insertions, 14 deletions
diff --git a/libssh/Makefile.in b/libssh/Makefile.in
index ecd25a92..ae6b20b1 100644
--- a/libssh/Makefile.in
+++ b/libssh/Makefile.in
@@ -6,8 +6,8 @@ OBJECTS= client.o packet.o dh.o crypt.o connect.o error.o buffer.o \
SHELL = /bin/sh
VPATH = @srcdir@
-subdirs = @subdirs@
top_srcdir = @top_srcdir@
+top_builddir = @top_builddir@
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
@@ -18,27 +18,34 @@ libdir = $(prefix)/lib/
mandir = $(prefix)/man/man1
CC = @CC@
-CFLAGS = @CFLAGS@ -Wall -g -I../include/ -fPIC
+CFLAGS = @CFLAGS@ -Wall -g -I../include/
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
INSTALL = @INSTALL@
-DYLIB_EXTENSION = @DYLIB_EXTENSION@
+LIBTOOL = @LIBTOOL@
LIBSSH_LDFLAGS = @LIBSSH_LDFLAGS@
+LIBSSH_VERS = @LIBSSH_VERS@
+LIBSSH_CURRENT = @LIBSSH_CURRENT@
+LIBSSH_REVISION = @LIBSSH_REVISION@
+LIBSSH_AGE = @LIBSSH_AGE@
+
+.c.o:
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $<
all: libssh.so
-libssh.so: $(OBJECTS)
- $(CC) -o libssh.$(DYLIB_EXTENSION) $(LIBSSH_LDFLAGS) $(OBJECTS) $(LIBS) $(LDFLAGS)
-libssh.a: $(OBJECTS)
- rm -f libssh.a
- ar q libssh.a $(OBJECTS)
- @RANLIB@ libssh.a
+libssh.la: $(OBJECTS) libssh.vers
+ $(LIBTOOL) --mode=link $(CC) -o libssh.la -export-dynamic -version-info $(LIBSSH_CURRENT):$(LIBSSH_REVISION):$(LIBSSH_AGE) -rpath $(libdir) $(OBJECTS:.o=.lo) $(LIBS) $(LIBSSH_LDFLAGS) $(LIBSSH_VERS) $(LDFLAGS)
+
+libssh.so: libssh.la
+libssh.a: libssh.la
+
install: all
$(top_srcdir)/mkinstalldirs $(incldir)
$(top_srcdir)/mkinstalldirs $(libdir)
- $(INSTALL) libssh.$(DYLIB_EXTENSION) $(libdir)
+ $(LIBTOOL) --mode=install $(INSTALL) libssh.la $(libdir)
clean:
- rm -f *~ libssh.a libssh.so *.o
+ $(LIBTOOL) --mode=clean rm -f *~ libssh.la *.lo
distclean: clean
rm -f Makefile
diff --git a/libssh/kex.c b/libssh/kex.c
index e069bf79..5097b06c 100644
--- a/libssh/kex.c
+++ b/libssh/kex.c
@@ -21,6 +21,7 @@ MA 02111-1307, USA. */
#include <string.h>
#include <stdlib.h>
+#include <stdio.h>
#include <netdb.h>
#include "libssh/priv.h"
#include "libssh/ssh2.h"
@@ -309,9 +310,21 @@ static void build_session_id1(SSH_SESSION *session, STRING *servern,
/* returns 1 if the modulus of k1 is < than the one of k2 */
static int modulus_smaller(PUBLIC_KEY *k1, PUBLIC_KEY *k2){
- RSA *r1=k1->rsa_pub;
- RSA *r2=k2->rsa_pub;
- if(BN_cmp(r1->n,r2->n)<0)
+ bignum n1;
+ bignum n2;
+#ifdef HAVE_LIBGCRYPT
+ gcry_sexp_t sexp;
+ sexp=gcry_sexp_find_token(k1->rsa_pub,"n",0);
+ n1=gcry_sexp_nth_mpi(sexp,1,GCRYMPI_FMT_STD);
+ gcry_sexp_release(sexp);
+ sexp=gcry_sexp_find_token(k2->rsa_pub,"n",0);
+ n2=gcry_sexp_nth_mpi(sexp,1,GCRYMPI_FMT_STD);
+ gcry_sexp_release(sexp);
+#elif defined HAVE_LIBCRYPTO
+ n1=k1->rsa_pub->n;
+ n2=k2->rsa_pub->n;
+#endif
+ if(bignum_cmp(n1,n2)<0)
return 1;
else
return 0;
diff --git a/libssh/libssh.vers b/libssh/libssh.vers
new file mode 100644
index 00000000..3afc8ce9
--- /dev/null
+++ b/libssh/libssh.vers
@@ -0,0 +1,59 @@
+SSH_0.2 {
+ global:
+ ssh_get_error; ssh_get_error_code; ssh_say; ssh_set_verbosity;
+ ssh_new; ssh_set_options; ssh_get_fd; ssh_silent_disconnect;
+ ssh_connect; ssh_disconnect; ssh_service_request; ssh_get_issue_banner;
+ ssh_copyright;
+ string_from_char; string_len; string_new; string_fill; string_to_char;
+ string_copy; string_burn; string_data;
+ ssh_crypto_init;
+ ssh_print_hexa; ssh_get_random;
+ ssh_get_pubkey_hash; ssh_get_pubkey;
+ ssh_fd_poll; ssh_select; publickey_free;
+ privatekey_from_file; publickey_to_string; publickey_from_privatekey;
+ private_key_free; publickey_from_file; publickey_from_next_file;
+ ssh_is_server_known; ssh_write_knownhost;
+ channel_new; channel_open_forward; channel_open_session; channel_free;
+ channel_request_pty; channel_request_pty_size; channel_change_pty_size;
+ channel_request_shell; channel_request_subsystem; channel_request_env;
+ channel_request_exec; channel_request_sftp; channel_write;
+ channel_send_eof; channel_read; channel_poll; channel_close;
+ channel_read_nonblocking; channel_is_open;
+ ssh_options_new; ssh_options_copy; ssh_options_set_wanted_algos;
+ ssh_options_set_username; ssh_options_set_port; ssh_options_getopt;
+ ssh_options_set_host; ssh_options_set_fd; ssh_options_set_bind;
+ ssh_options_set_identity; ssh_options_set_status_callback;
+ ssh_options_set_timeout; ssh_options_set_ssh_dir;
+ ssh_options_set_known_hosts_file; ssh_options_allow_ssh1;
+ ssh_options_allow_ssh2; ssh_options_set_dsa_server_key;
+ ssh_options_set_rsa_server_key;
+ buffer_new; buffer_free; buffer_get; buffer_get_len;
+ ssh_userauth_none; ssh_userauth_password; ssh_userauth_offer_pubkey;
+ ssh_userauth_pubkey; ssh_userauth_autopubkey; ssh_userauth_kbdint;
+ ssh_userauth_kbdint_getnprompts; ssh_userauth_kbdint_getname;
+ ssh_userauth_kbdint_getinstruction; ssh_userauth_kbdint_getprompt;
+ ssh_userauth_kbdint_setanswer;
+ sftp_new; sftp_free; sftp_init; sftp_opendir; sftp_readdir; sftp_dir_eof;
+ sftp_stat; sftp_lstat; sftp_fstat; sftp_attributes_free; sftp_dir_close;
+ sftp_file_close; sftp_open; sftp_read; sftp_write; sftp_seek; sftp_tell;
+ sftp_rewind; sftp_rm; sftp_rmdir; sftp_mkdir; sftp_rename; sftp_setstat;
+ sftp_canonicalize_path; sftp_server_new; sftp_server_init;
+ sftp_get_client_message; sftp_client_message_free; sftp_reply_name;
+ sftp_reply_handle; sftp_handle_alloc; sftp_reply_attr; sftp_handle;
+ sftp_reply_status; sftp_reply_names_add; sftp_reply_names;
+ sftp_reply_data; sftp_handle_remove;
+ ssh_bind_new; ssh_bind_set_options; ssh_bind_listen; ssh_bind_set_blocking;
+ ssh_bind_get_fd; ssh_bind_set_toaccept; ssh_bind_accept; ssh_bind_free;
+ ssh_accept;
+ ssh_message_get; ssh_message_type; ssh_message_subtype;
+ ssh_message_reply_default; ssh_message_free; ssh_message_auth_user;
+ ssh_message_auth_password; ssh_message_auth_reply_success;
+ ssh_message_auth_set_methods;
+ ssh_message_channel_request_open_reply_accept;
+ ssh_message_channel_request_channel; ssh_message_channel_request_pty_term;
+ ssh_message_channel_request_subsystem;
+ ssh_message_channel_request_reply_success;
+ set_encrypt_key; set_decrypt_key; cbc_encrypt; cbc_decrypt;
+ local:
+ *;
+};