Finally lay dependencies to rest (I hope!).
[openssl.git] / crypto / x509 / x509_obj.c
index 2b53af1e6122ef09c9b5f5d2fbf703d7c8eed67a..c0576fd6f6f40e5bca9f1796dcc82ee2d6f72e04 100644 (file)
@@ -1,5 +1,5 @@
 /* crypto/x509/x509_obj.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
@@ -76,6 +76,7 @@ int len;
        BUF_MEM *b=NULL;
        static char hex[17]="0123456789ABCDEF";
        int gs_doit[4];
+       char tmp_buf[80];
 
        if (a == NULL) return("NO X509_NAME");
        if (buf == NULL)
@@ -92,12 +93,10 @@ int len;
                {
                ne=(X509_NAME_ENTRY *)sk_value(a->entries,i);
                n=OBJ_obj2nid(ne->object);
-               if (n == NID_undef)
-                       s="UNKNOWN";
-               else
+               if ((n == NID_undef) || ((s=OBJ_nid2sn(n)) == NULL))
                        {
-                       s=OBJ_nid2sn(n);
-                       if (s == NULL) s="UNKNOWN2";
+                       i2t_ASN1_OBJECT(tmp_buf,sizeof(tmp_buf),ne->object);
+                       s=tmp_buf;
                        }
                l1=strlen(s);