Make pkcs8 work again.

Make EVP_CIPHER_type() return NID_undef if the cipher has no
ASN1 OID, modify code to handle this.
This commit is contained in:
Dr. Stephen Henson
2000-02-22 18:45:11 +00:00
parent 3f2b5a88ad
commit 4b42658082
4 changed files with 23 additions and 12 deletions

View File

@@ -115,6 +115,7 @@ int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
int EVP_CIPHER_type(const EVP_CIPHER *ctx)
{
int nid;
ASN1_OBJECT *otmp;
nid = EVP_CIPHER_nid(ctx);
switch(nid) {
@@ -131,7 +132,10 @@ int EVP_CIPHER_type(const EVP_CIPHER *ctx)
return NID_rc4;
default:
/* Check it has an OID and it is valid */
otmp = OBJ_nid2obj(nid);
if(!otmp || !otmp->data) nid = NID_undef;
ASN1_OBJECT_free(otmp);
return nid;
}
}