summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/tasn_utl.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2016-03-04 14:55:24 +0000
committerDr. Stephen Henson <steve@openssl.org>2016-03-04 17:06:13 +0000
commit5b70372d5d26bc06a501b48caba2be9d59e855e4 (patch)
tree698874d42168f9128bcbf2585fb77479bd144a2d /crypto/asn1/tasn_utl.c
parentfbff671659bd51a7b124065ea6caf5b554111211 (diff)
Add ASN.1 ADB callback.
Add support for application supplied any defined by callback. An application can change the selector value if it wishes. This is mainly intended for values which are only known at runtime, for example dynamically created OIDs. Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/asn1/tasn_utl.c')
-rw-r--r--crypto/asn1/tasn_utl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/asn1/tasn_utl.c b/crypto/asn1/tasn_utl.c
index 51f22aa7c6..c840047cdf 100644
--- a/crypto/asn1/tasn_utl.c
+++ b/crypto/asn1/tasn_utl.c
@@ -243,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