/* Now generate the key and initialization vector.
* (again it is the perl Crypt::CBC way, with a touch of
* fwknop).
- */
+ */
memcpy(tmp_buf+16, pw_buf, 16);
memcpy(tmp_buf+32, ctx->salt, 8);
const unsigned char *data, int encryption_mode)
{
- /* Use ECB mode to be compatible with the Crypt::CBC perl module.
+ /* The default (set in fko.h) is ECB mode to be compatible with the
+ * Crypt::CBC perl module.
*/
ctx->mode = encryption_mode;
#include "fko_common.h"
/* Other block sizes and key lengths are possible, but in the context of
- * the ssh protocols, 256 bits is the default.
+ * the ssh protocols, 256 bits is the default.
*/
#define RIJNDAEL_BLOCKSIZE 16
#define RIJNDAEL_KEYSIZE 32
* bits). If a value other than these three is specified, the key will be
* truncated to the closest value less than the key size specified, e.g.
* specifying 7 will use only the first 6 bytes of the key given. DO NOT
- * PASS A VALUE LESS THAN 16 TO KEYSIZE!
+ * PASS A VALUE LESS THAN 16 TO KEYSIZE!
*/
void
rijndael_setup(RIJNDAEL_context *ctx, size_t keysize, const uint8_t *key);
*
* Before this function can be used, rijndael_setup() must be used in order
* to set up the key schedule required for the decryption algorithm.
- *
+ *
* This function always decrypts 16 bytes of ciphertext to 16 bytes of
* plaintext. The memory areas of the plaintext and the ciphertext can
* overlap.
--- /dev/null
+SOURCE: ANY;
+KEY: fwknoptest;
+FW_ACCESS_TIMEOUT: 3;
+ENCRYPTION_MODE: CBC;
my $nat_conf = "$conf_dir/nat_fwknopd.conf";
my $default_conf = "$conf_dir/default_fwknopd.conf";
my $default_access_conf = "$conf_dir/default_access.conf";
+my $cbc_mode_access_conf = "$conf_dir/cbc_mode_access.conf";
my $expired_access_conf = "$conf_dir/expired_stanza_access.conf";
my $future_expired_access_conf = "$conf_dir/future_expired_stanza_access.conf";
my $expired_epoch_access_conf = "$conf_dir/expired_epoch_stanza_access.conf";
'server_conf' => $nat_conf,
'fatal' => $NO
},
+ {
+ 'category' => 'Rijndael SPA',
+ 'subcategory' => 'client+server',
+ 'detail' => 'CBC mode (tcp/22 ssh)',
+ 'err_msg' => 'could not complete SPA cycle',
+ 'function' => \&spa_cycle,
+ 'cmdline' => "$default_client_args -M cbc",
+ 'fwknopd_cmdline' => "LD_LIBRARY_PATH=$lib_dir $valgrind_str " .
+ "$fwknopdCmd -c $default_conf -a $cbc_mode_access_conf " .
+ "-d $default_digest_file -p $default_pid_file $intf_str",
+ 'server_negative_output_matches' => [qr/Decryption\sfailed/i],
+ 'fw_rule_created' => $NEW_RULE_REQUIRED,
+ 'fw_rule_removed' => $NEW_RULE_REMOVED,
+ 'fatal' => $NO
+ },
{
'category' => 'Rijndael SPA',