Add default ASN1 handling to support FIPS.
authorDr. Stephen Henson <steve@openssl.org>
Sun, 29 May 2011 02:32:05 +0000 (02:32 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sun, 29 May 2011 02:32:05 +0000 (02:32 +0000)
crypto/evp/evp_lib.c

index 40951a04f0c9344c1f45b3780d86b28990aefcd0..b180e4828a8c8901727ffb7676203add0d82ba5c 100644 (file)
@@ -67,6 +67,8 @@ int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
 
        if (c->cipher->set_asn1_parameters != NULL)
                ret=c->cipher->set_asn1_parameters(c,type);
+       else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1)
+               ret=EVP_CIPHER_set_asn1_iv(c, type);
        else
                ret=-1;
        return(ret);
@@ -78,6 +80,8 @@ int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
 
        if (c->cipher->get_asn1_parameters != NULL)
                ret=c->cipher->get_asn1_parameters(c,type);
+       else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1)
+               ret=EVP_CIPHER_get_asn1_iv(c, type);
        else
                ret=-1;
        return(ret);