aboutsummaryrefslogtreecommitdiffstats
path: root/g10/cipher.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1998-04-04 20:16:55 +0000
committerWerner Koch <[email protected]>1998-04-04 20:16:55 +0000
commit53a578711fe65b97c14539048dc9015dc5026da8 (patch)
tree2d358795a9d14fd7dcfe9f7a82e32363038ea8c5 /g10/cipher.c
parentstarted with keyserver (diff)
downloadgnupg-53a578711fe65b97c14539048dc9015dc5026da8.tar.gz
gnupg-53a578711fe65b97c14539048dc9015dc5026da8.zip
cast5 does now work
Diffstat (limited to '')
-rw-r--r--g10/cipher.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/g10/cipher.c b/g10/cipher.c
index 52da03b58..8e6c91aa9 100644
--- a/g10/cipher.c
+++ b/g10/cipher.c
@@ -74,6 +74,13 @@ cipher_filter( void *opaque, int control,
blowfish_setiv( cfx->bf_ctx, NULL );
blowfish_encode_cfb( cfx->bf_ctx, temp, temp, 10);
}
+ else if( cfx->dek->algo == CIPHER_ALGO_CAST ) {
+ cfx->cast5_ctx = m_alloc_secure( sizeof *cfx->cast5_ctx );
+ cast5_setkey( cfx->cast5_ctx, cfx->dek->key, cfx->dek->keylen );
+ cast5_setiv( cfx->cast5_ctx, NULL );
+ cast5_encode_cfb( cfx->cast5_ctx, temp, temp, 10);
+ cast5_sync_cfb( cfx->cast5_ctx );
+ }
else
log_bug("no cipher algo %d\n", cfx->dek->algo);
@@ -84,6 +91,9 @@ cipher_filter( void *opaque, int control,
if( cfx->dek->algo == CIPHER_ALGO_BLOWFISH
|| cfx->dek->algo == CIPHER_ALGO_BLOWFISH128 )
blowfish_encode_cfb( cfx->bf_ctx, buf, buf, size);
+ else if( cfx->dek->algo == CIPHER_ALGO_CAST )
+ cast5_encode_cfb( cfx->cast5_ctx, buf, buf, size);
+
if( iobuf_write( a, buf, size ) )
rc = G10ERR_WRITE_FILE;
}
@@ -91,6 +101,8 @@ cipher_filter( void *opaque, int control,
if( cfx->dek->algo == CIPHER_ALGO_BLOWFISH
|| cfx->dek->algo == CIPHER_ALGO_BLOWFISH128 )
m_free(cfx->bf_ctx);
+ else if( cfx->dek->algo == CIPHER_ALGO_CAST )
+ m_free(cfx->cast5_ctx);
}
else if( control == IOBUFCTRL_DESC ) {
*(char**)buf = "cipher_filter";