summaryrefslogtreecommitdiff
path: root/lib/int.h
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2012-11-24 16:23:08 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2012-11-24 16:23:08 +0100
commit8cd1f611d962eb62db6b5beb5b395597ce463110 (patch)
tree4ced6a74767fba2be7c128bc0f9ffddf4648c4c9 /lib/int.h
parent37c47bd8102ec213ee8d53c2800232a9bb7bace2 (diff)
downloadlibtasn1-8cd1f611d962eb62db6b5beb5b395597ce463110.tar.gz
libtasn1-8cd1f611d962eb62db6b5beb5b395597ce463110.tar.bz2
libtasn1-8cd1f611d962eb62db6b5beb5b395597ce463110.zip
simplified
Diffstat (limited to 'lib/int.h')
-rw-r--r--lib/int.h17
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/int.h b/lib/int.h
index f1a3f17..ce20ab2 100644
--- a/lib/int.h
+++ b/lib/int.h
@@ -158,16 +158,7 @@ extern const tag_and_class_st _asn1_tags[];
/****************************************/
inline static unsigned int type_field(unsigned int ntype)
{
-unsigned int type = ntype & 0xff;
- if (type == ASN1_ETYPE_TIME)
- {
- if (type & CONST_UTC)
- type = ASN1_ETYPE_UTC_TIME;
- else
- type = ASN1_ETYPE_GENERALIZED_TIME;
- }
-
- return type;
+ return (ntype & 0xff);
}
/* To convert old types from a static structure */
@@ -181,7 +172,11 @@ unsigned int type = ntype & 0xff;
else
type = ASN1_ETYPE_GENERALIZED_TIME;
- return type | ((ntype>>8)<<8);
+ ntype &= ~(CONST_UTC|CONST_GENERALIZED);
+ ntype &= 0xffffff00;
+ ntype |= type;
+
+ return ntype;
}
else
return ntype;