Fix typo in SSL_pending docs
[openssl.git] / crypto / asn1 / tasn_utl.c
index 10cc1f9143a13553eb399e85f0c44516f34caee0..c840047cdf6576fcf380374ded078591b56e5e54 100644 (file)
@@ -1,4 +1,3 @@
-/* tasn_utl.c */
 /*
  * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
  * 2000.
@@ -119,12 +118,9 @@ int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it)
     }
     ret = CRYPTO_add(lck, op, aux->ref_lock);
 #ifdef REF_PRINT
-    fprintf(stderr, "%s: Reference Count: %d\n", it->sname, *lck);
-#endif
-#ifdef REF_CHECK
-    if (ret < 0)
-        fprintf(stderr, "%s, bad reference count\n", it->sname);
+    fprintf(stderr, "%p:%4d:%s\n", it, *lck, it->sname);
 #endif
+    REF_ASSERT_ISNT(ret < 0);
     return ret;
 }
 
@@ -247,6 +243,12 @@ const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt,
     else
         selector = ASN1_INTEGER_get((ASN1_INTEGER *)*sfld);
 
+    /* Let application callback translate value */
+    if (adb->adb_cb != NULL && adb->adb_cb(&selector) == 0) {
+        ASN1err(ASN1_F_ASN1_DO_ADB, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE);
+        return NULL;
+    }
+
     /*
      * Try to find matching entry in table Maybe should check application
      * types first to allow application override? Might also be useful to