summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2018-01-09 16:05:36 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2018-01-09 16:05:36 +0100
commit7e7feec1f4f6815fe9e0afd161540c8228aa6add (patch)
treebd1d3dbbac4586405e9023efd198a11bf6a068b6
parent2529b32a00140b1a636bc5716780347b8b98ee94 (diff)
downloadlibtasn1-7e7feec1f4f6815fe9e0afd161540c8228aa6add.tar.gz
Improved documentation on decoding flags
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r--lib/decoding.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/decoding.c b/lib/decoding.c
index 0ee35d3..05dc236 100644
--- a/lib/decoding.c
+++ b/lib/decoding.c
@@ -43,12 +43,19 @@
#define HAVE_TWO(x) (x>=2?1:0)
+/* Decoding flags (dflags) used in several decoding functions.
+ * DECODE_FLAG_HAVE_TAG: The provided buffer includes a tag
+ * DECODE_FLAG_INDEFINITE: The provided buffer is of indefinite encoding (useful
+ * when no tags are present).
+ * DECODE_FLAG_LEVEL1: Internal flag to indicate a level of recursion for BER strings.
+ * DECODE_FLAG_LEVEL2: Internal flag to indicate two levels of recursion for BER strings.
+ * DECODE_FLAG_LEVEL3: Internal flag to indicate three levels of recursion for BER strings.
+ * This is the maximum levels of recursion possible to prevent stack
+ * exhaustion.
+ */
+
#define DECODE_FLAG_HAVE_TAG 1
#define DECODE_FLAG_INDEFINITE (1<<1)
-/* On indefinite string decoding, allow this maximum levels
- * of recursion. Allowing infinite recursion, makes the BER
- * decoder susceptible to stack exhaustion due to that recursion.
- */
#define DECODE_FLAG_LEVEL1 (1<<2)
#define DECODE_FLAG_LEVEL2 (1<<3)
#define DECODE_FLAG_LEVEL3 (1<<4)