Import of old SSLeay release: SSLeay 0.9.0b
[openssl.git] / crypto / asn1 / x_pubkey.c
index b1a2499d349425345116a2b4bb69f0393850902e..a309cf74a79487335ef6668afb13a8d59cee03f5 100644 (file)
@@ -1,5 +1,5 @@
 /* crypto/asn1/x_pubkey.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
  * This package is an SSL implementation written
@@ -211,12 +211,16 @@ X509_PUBKEY *key;
        long j;
        int type;
        unsigned char *p;
+#ifndef NO_DSA
        X509_ALGOR *a;
+#endif
+
+       if (key == NULL) goto err;
+
+       if (key->pkey != NULL) return(key->pkey);
+
+       if (key->public_key == NULL) goto err;
 
-       if (key->pkey != NULL)
-               {
-               return(key->pkey);
-               }
        type=OBJ_obj2nid(key->algor->algorithm);
        p=key->public_key->data;
         j=key->public_key->length;