unsigned char *key;
size_t key_len;
unsigned char *iv;
+ unsigned int rounds;
size_t iv_len;
unsigned char *plaintext;
size_t plaintext_len;
if (strcmp(keyword, "Key") == 0)
return parse_bin(value, &cdat->key, &cdat->key_len);
+ if (strcmp(keyword, "Rounds") == 0) {
+ i = atoi(value);
+ if (i < 0)
+ return -1;
+ cdat->rounds = (unsigned int)i;
+ return 1;
+ }
if (strcmp(keyword, "IV") == 0)
return parse_bin(value, &cdat->iv, &cdat->iv_len);
if (strcmp(keyword, "Plaintext") == 0)
}
}
+ if (expected->rounds > 0) {
+ int rounds = (int)expected->rounds;
+
+ if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC5_ROUNDS, rounds, NULL)) {
+ t->err = "INVALID_ROUNDS";
+ goto err;
+ }
+ }
+
if (!EVP_CIPHER_CTX_set_key_length(ctx, expected->key_len)) {
t->err = "INVALID_KEY_LENGTH";
goto err;