From: Dr. Stephen Henson Date: Mon, 15 Feb 2010 19:17:55 +0000 (+0000) Subject: add EVP_CIPH_FLAG_LENGTH_BITS from 0.9.8-stable X-Git-Tag: OpenSSL_1_0_0~52 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=f689ab5017d39a7b339dbf9ede0895597be606b4;ds=sidebyside add EVP_CIPH_FLAG_LENGTH_BITS from 0.9.8-stable --- diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h index f0848d24a0..6714bbb674 100644 --- a/crypto/evp/evp.h +++ b/crypto/evp/evp.h @@ -342,6 +342,10 @@ struct evp_cipher_st #define EVP_CIPH_RAND_KEY 0x200 /* cipher has its own additional copying logic */ #define EVP_CIPH_CUSTOM_COPY 0x400 +/* Allow use default ASN1 get/set iv */ +#define EVP_CIPH_FLAG_DEFAULT_ASN1 0x1000 +/* Buffer length in bits not bytes: CFB1 mode only */ +#define EVP_CIPH_FLAG_LENGTH_BITS 0x2000 /* ctrl() values */ diff --git a/crypto/evp/evp_locl.h b/crypto/evp/evp_locl.h index 34e4a65af6..465747471e 100644 --- a/crypto/evp/evp_locl.h +++ b/crypto/evp/evp_locl.h @@ -115,7 +115,7 @@ static int cname##_cfb##cbits##_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, if (inl=chunk)\ {\ - cprefix##_cfb##cbits##_encrypt(in, out, (long)(cbits==1?chunk*8:chunk), &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, &ctx->num, ctx->encrypt);\ + cprefix##_cfb##cbits##_encrypt(in, out, (long)((cbits==1) && !(ctx->flags & EVP_CIPH_FLAG_LENGTH_BITS) ?inl*8:inl), &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, &ctx->num, ctx->encrypt);\ inl-=chunk;\ in +=chunk;\ out+=chunk;\