projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Callbacks
[tinc]
/
src
/
meta.c
diff --git
a/src/meta.c
b/src/meta.c
index
c036782
..
2c4b734
100644
(file)
--- a/
src/meta.c
+++ b/
src/meta.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: meta.c,v 1.
3 2002/04/13 11:07:12
zarq Exp $
+ $Id: meta.c,v 1.
4 2002/04/28 12:46:26
zarq Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-51,7
+51,12
@@
cp
if(c->status.encryptout)
{
if(c->status.encryptout)
{
+#ifdef USE_OPENSSL
EVP_EncryptUpdate(c->outctx, outbuf, &outlen, buffer, length);
EVP_EncryptUpdate(c->outctx, outbuf, &outlen, buffer, length);
+#endif
+#ifdef USE_GCRYPT
+ outlen = gcry_cipher_encrypt(c->outctx, outbuf, sizeof(outbuf), buffer, length);
+#endif
bufp = outbuf;
length = outlen;
}
bufp = outbuf;
length = outlen;
}
@@
-140,7
+145,12
@@
cp
if(c->status.decryptin && !decrypted)
{
if(c->status.decryptin && !decrypted)
{
+#ifdef USE_OPENSSL
EVP_DecryptUpdate(c->inctx, inbuf, &lenin, c->buffer + oldlen, lenin);
EVP_DecryptUpdate(c->inctx, inbuf, &lenin, c->buffer + oldlen, lenin);
+#endif
+#ifdef USE_GCRYPT
+ lenin = gcry_cipher_decrypt(c->inctx, inbuf, sizeof(inbuf), c->buffer + oldlen, lenin);
+#endif
memcpy(c->buffer + oldlen, inbuf, lenin);
decrypted = 1;
}
memcpy(c->buffer + oldlen, inbuf, lenin);
decrypted = 1;
}