aboutsummaryrefslogtreecommitdiff
path: root/libssh/kex.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2005-10-04 22:11:19 +0000
committerAris Adamantiadis <aris@0xbadc0de.be>2005-10-04 22:11:19 +0000
commit5f7c84f900b81e3bbff55378f8170ddf150daf9c (patch)
tree2076a6416e087eb5870c2217873ae76e85451f6b /libssh/kex.c
parentc0525750fd090bca0f1ab1884cc26ecd227addb7 (diff)
downloadlibssh-5f7c84f900b81e3bbff55378f8170ddf150daf9c.tar.gz
libssh-5f7c84f900b81e3bbff55378f8170ddf150daf9c.tar.xz
libssh-5f7c84f900b81e3bbff55378f8170ddf150daf9c.zip
added the gcrypt patch (without gcrypt as default library).
still needs tests. git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@38 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/kex.c')
-rw-r--r--libssh/kex.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/libssh/kex.c b/libssh/kex.c
index 7b7722e..e069bf7 100644
--- a/libssh/kex.c
+++ b/libssh/kex.c
@@ -26,6 +26,11 @@ MA 02111-1307, USA. */
#include "libssh/ssh2.h"
#include "libssh/ssh1.h"
+#ifdef HAVE_LIBGCRYPT
+#define BLOWFISH "blowfish-cbc,"
+#define AES "aes256-cbc,aes192-cbc,aes128-cbc,"
+#define DES "3des-cbc"
+#elif defined HAVE_LIBCRYPTO
#ifdef HAVE_OPENSSL_BLOWFISH_H
#define BLOWFISH "blowfish-cbc,"
#else
@@ -36,13 +41,15 @@ MA 02111-1307, USA. */
#else
#define AES ""
#endif
-
#define DES "3des-cbc"
+#endif
+
#ifdef HAVE_LIBZ
#define ZLIB "none,zlib"
#else
#define ZLIB "none"
#endif
+
char *default_methods[]={
"diffie-hellman-group1-sha1","ssh-dss,ssh-rsa",AES BLOWFISH DES,AES BLOWFISH
DES, "hmac-sha1","hmac-sha1","none","none","","",NULL };
@@ -286,7 +293,7 @@ static STRING *make_rsa1_string(STRING *e, STRING *n){
static void build_session_id1(SSH_SESSION *session, STRING *servern,
STRING *hostn){
- MD5CTX *md5=md5_init();
+ MD5CTX md5=md5_init();
#ifdef DEBUG_CRYPTO
ssh_print_hexa("host modulus",hostn->string,string_len(hostn));
ssh_print_hexa("server modulus",servern->string,string_len(servern));
@@ -313,7 +320,7 @@ static int modulus_smaller(PUBLIC_KEY *k1, PUBLIC_KEY *k2){
#define ABS(A) ( (A)<0 ? -(A):(A) )
STRING *encrypt_session_key(SSH_SESSION *session, PUBLIC_KEY *svrkey,
PUBLIC_KEY *hostkey,int slen, int hlen ){
- char buffer[32];
+ unsigned char buffer[32];
int i;
STRING *data1,*data2;
/* first, generate a session key */