aboutsummaryrefslogtreecommitdiff
path: root/src/lib/krb5
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2008-08-07 03:06:50 +0000
committerKen Raeburn <raeburn@mit.edu>2008-08-07 03:06:50 +0000
commit660520617d845a3159ae573e0609fd12e95a0815 (patch)
tree8a0daba6a478b80601758c514779cdafa8500be2 /src/lib/krb5
parent3ad7c4b93b0f3a79a1526a3da7b897f6e13875d3 (diff)
downloadkrb5-660520617d845a3159ae573e0609fd12e95a0815.zip
krb5-660520617d845a3159ae573e0609fd12e95a0815.tar.gz
krb5-660520617d845a3159ae573e0609fd12e95a0815.tar.bz2
get_eoc() is always followed by next_tag(), so don't bother setting
the variables that it's about to clobber. Since we don't need any of the tag info at the call site, push it down into the helper function. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20631 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5')
-rw-r--r--src/lib/krb5/asn.1/asn1_k_decode.c22
-rw-r--r--src/lib/krb5/asn.1/krb5_decode.c20
2 files changed, 16 insertions, 26 deletions
diff --git a/src/lib/krb5/asn.1/asn1_k_decode.c b/src/lib/krb5/asn.1/asn1_k_decode.c
index e1d9bb2..91e6ffc 100644
--- a/src/lib/krb5/asn.1/asn1_k_decode.c
+++ b/src/lib/krb5/asn.1/asn1_k_decode.c
@@ -53,30 +53,24 @@
}
static asn1_error_code
-asn1_get_eoc_tag (asn1buf *buf, taginfo *tinfo)
+asn1_get_eoc_tag (asn1buf *buf)
{
asn1_error_code retval;
+ taginfo t;
- retval = asn1_get_tag_2(buf, tinfo);
+ retval = asn1_get_tag_2(buf, &t);
if (retval)
return retval;
- if (tinfo->asn1class != UNIVERSAL || tinfo->tagnum || tinfo->indef)
+ if (t.asn1class != UNIVERSAL || t.tagnum || t.indef)
return ASN1_MISSING_EOC;
return 0;
}
/* Force check for EOC tag. */
-#define get_eoc() \
- { \
- taginfo t3; \
- retval = asn1_get_eoc_tag(&subbuf, &t3); \
- if(retval) return retval; \
- /* Copy out to match previous functionality, until better integrated. */ \
- asn1class = UNIVERSAL; \
- construction = t3.construction; \
- tagnum = 0; \
- taglen = t3.length; \
- indef = 0; \
+#define get_eoc() \
+ { \
+ retval = asn1_get_eoc_tag(&subbuf); \
+ if(retval) return retval; \
}
#define alloc_field(var, type) \
diff --git a/src/lib/krb5/asn.1/krb5_decode.c b/src/lib/krb5/asn.1/krb5_decode.c
index f071cbf..8c6bef7 100644
--- a/src/lib/krb5/asn.1/krb5_decode.c
+++ b/src/lib/krb5/asn.1/krb5_decode.c
@@ -94,27 +94,23 @@ if((var) == NULL) clean_return(ENOMEM)
}
static asn1_error_code
-asn1_get_eoc_tag (asn1buf *buf, taginfo *tinfo)
+asn1_get_eoc_tag (asn1buf *buf)
{
asn1_error_code retval;
+ taginfo t;
- retval = asn1_get_tag_2(buf, tinfo);
+ retval = asn1_get_tag_2(buf, &t);
if (retval)
return retval;
- if (tinfo->asn1class != UNIVERSAL || tinfo->tagnum || tinfo->indef)
+ if (t.asn1class != UNIVERSAL || t.tagnum || t.indef)
return ASN1_MISSING_EOC;
return 0;
}
-#define get_eoc() \
-{ \
- taginfo t3; \
- retval = asn1_get_eoc_tag(&subbuf, &t3); \
- if (retval) return retval; \
- asn1class = UNIVERSAL; \
- construction = t3.construction; \
- tagnum = 0; \
- indef = 0; \
+#define get_eoc() \
+{ \
+ retval = asn1_get_eoc_tag(&subbuf); \
+ if (retval) return retval; \
}
/* decode sequence header and initialize tagnum with the first field */