# HG changeset patch # User Matt Johnston # Date 1115631153 0 # Node ID e972be139cb5444e7f96c3d9a10348624544ae7c # Parent ca6a7c7a925c8790ee059eadbf952dc3e20fd4e4 Switching to libtomcrypt 1.02 (still has problems) diff -r ca6a7c7a925c -r e972be139cb5 algo.h --- a/algo.h Mon May 09 09:31:49 2005 +0000 +++ b/algo.h Mon May 09 09:32:33 2005 +0000 @@ -51,13 +51,13 @@ extern const struct dropbear_hash dropbear_nohash; struct dropbear_cipher { - const struct _cipher_descriptor *cipherdesc; + const struct ltc_cipher_descriptor *cipherdesc; unsigned long keysize; unsigned char blocksize; }; struct dropbear_hash { - const struct _hash_descriptor *hashdesc; + const struct ltc_hash_descriptor *hashdesc; unsigned long keysize; unsigned char hashsize; }; diff -r ca6a7c7a925c -r e972be139cb5 common-algo.c --- a/common-algo.c Mon May 09 09:31:49 2005 +0000 +++ b/common-algo.c Mon May 09 09:32:33 2005 +0000 @@ -125,7 +125,7 @@ * This should be run before using any of the ciphers/hashes */ void crypto_init() { - const struct _cipher_descriptor *regciphers[] = { + const struct ltc_cipher_descriptor *regciphers[] = { #ifdef DROPBEAR_AES128_CBC &aes_desc, #endif @@ -141,7 +141,7 @@ NULL }; - const struct _hash_descriptor *reghashes[] = { + const struct ltc_hash_descriptor *reghashes[] = { /* we need sha1 for hostkey stuff regardless */ &sha1_desc, #ifdef DROPBEAR_MD5_HMAC diff -r ca6a7c7a925c -r e972be139cb5 includes.h --- a/includes.h Mon May 09 09:31:49 2005 +0000 +++ b/includes.h Mon May 09 09:32:33 2005 +0000 @@ -111,7 +111,7 @@ #include #endif -#include "libtomcrypt/mycrypt.h" +#include "libtomcrypt/src/headers/tomcrypt.h" #include "libtommath/tommath.h" #include "compat.h" diff -r ca6a7c7a925c -r e972be139cb5 packet.c --- a/packet.c Mon May 09 09:31:49 2005 +0000 +++ b/packet.c Mon May 09 09:32:33 2005 +0000 @@ -201,6 +201,7 @@ /* decrypt it */ if (cbc_decrypt(buf_getptr(ses.readbuf, blocksize), buf_getwriteptr(ses.decryptreadbuf,blocksize), + blocksize, &ses.keys->recv_symmetric_struct) != CRYPT_OK) { dropbear_exit("error decrypting"); } @@ -254,6 +255,7 @@ while (ses.readbuf->pos < ses.readbuf->len - macsize) { if (cbc_decrypt(buf_getptr(ses.readbuf, blocksize), buf_getwriteptr(ses.decryptreadbuf, blocksize), + blocksize, &ses.keys->recv_symmetric_struct) != CRYPT_OK) { dropbear_exit("error decrypting"); } @@ -491,6 +493,7 @@ while (clearwritebuf->pos < clearwritebuf->len) { if (cbc_encrypt(buf_getptr(clearwritebuf, blocksize), buf_getwriteptr(writebuf, blocksize), + blocksize, &ses.keys->trans_symmetric_struct) != CRYPT_OK) { dropbear_exit("error encrypting"); }