diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-11-24 16:23:08 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-11-24 16:23:08 +0100 |
commit | 8cd1f611d962eb62db6b5beb5b395597ce463110 (patch) | |
tree | 4ced6a74767fba2be7c128bc0f9ffddf4648c4c9 /lib/int.h | |
parent | 37c47bd8102ec213ee8d53c2800232a9bb7bace2 (diff) | |
download | libtasn1-8cd1f611d962eb62db6b5beb5b395597ce463110.tar.gz libtasn1-8cd1f611d962eb62db6b5beb5b395597ce463110.tar.bz2 libtasn1-8cd1f611d962eb62db6b5beb5b395597ce463110.zip |
simplified
Diffstat (limited to 'lib/int.h')
-rw-r--r-- | lib/int.h | 17 |
1 files changed, 6 insertions, 11 deletions
@@ -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; |