1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

cast5 does now work

This commit is contained in:
Werner Koch 1998-04-04 20:16:55 +00:00
parent aa713cb0f5
commit 53a578711f
22 changed files with 644 additions and 183 deletions

View file

@ -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";