summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;