test1_exit(5);
}
EVP_CIPHER_CTX_init(&ctx);
+ EVP_CIPHER_CTX_set_flags(&ctx,EVP_CIPHER_CTX_FLAG_WRAP_ALLOW);
if (encdec != 0)
{
if (mode == EVP_CIPH_GCM_MODE)
test1_exit(13);
}
}
+ else if (mode == EVP_CIPH_WRAP_MODE)
+ {
+ if(!EVP_EncryptInit_ex(&ctx,c,NULL,key,in ? iv : NULL))
+ {
+ fprintf(stderr,"EncryptInit failed\n");
+ ERR_print_errors_fp(stderr);
+ test1_exit(10);
+ }
+ }
else if(!EVP_EncryptInit_ex(&ctx,c,NULL,key,iv))
{
fprintf(stderr,"EncryptInit failed\n");
test1_exit(13);
}
}
+ else if (mode == EVP_CIPH_WRAP_MODE)
+ {
+ if(!EVP_DecryptInit_ex(&ctx,c,NULL,key,in ? iv : NULL))
+ {
+ fprintf(stderr,"EncryptInit failed\n");
+ ERR_print_errors_fp(stderr);
+ test1_exit(10);
+ }
+ }
else if(!EVP_DecryptInit_ex(&ctx,c,NULL,key,iv))
{
fprintf(stderr,"DecryptInit failed\n");
perror(szTestFile);
EXIT(2);
}
-
+ ERR_load_crypto_strings();
/* Load up the software EVP_CIPHER and EVP_MD definitions */
OpenSSL_add_all_ciphers();
OpenSSL_add_all_digests();
char *cipher;
unsigned char *iv,*key,*plaintext,*ciphertext,*aad,*tag;
int encdec;
- int kn,in,pn,cn,an,tn;
+ int kn,in,pn,cn;
+ int an = 0;
+ int tn = 0;
if(!fgets((char *)line,sizeof line,f))
break;