diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2000-02-22 19:45:11 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2000-02-22 19:45:11 +0100 |
commit | 4b42658082a3d6224d25f10de8fdb605d30015a9 (patch) | |
tree | 6c9ce1e8f0f222d9a1de90de288b184436a23db4 /crypto/evp/evp_lib.c | |
parent | Update docs. (diff) | |
download | openssl-4b42658082a3d6224d25f10de8fdb605d30015a9.tar.xz openssl-4b42658082a3d6224d25f10de8fdb605d30015a9.zip |
Make pkcs8 work again.
Make EVP_CIPHER_type() return NID_undef if the cipher has no
ASN1 OID, modify code to handle this.
Diffstat (limited to 'crypto/evp/evp_lib.c')
-rw-r--r-- | crypto/evp/evp_lib.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c index 3f9bf55828..a431945ef5 100644 --- a/crypto/evp/evp_lib.c +++ b/crypto/evp/evp_lib.c @@ -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; } } |