diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-11-24 10:41:33 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-11-24 10:41:33 +0100 |
commit | 2ac0d04b5f8571866e729e9d816ea69780892634 (patch) | |
tree | 38b4ec7e74c3dceb88726e7b42e18253af2e1a46 /lib/int.h | |
parent | bbfe113c2d7540c6883eb3d83d7052f49f7988fc (diff) | |
download | libtasn1-2ac0d04b5f8571866e729e9d816ea69780892634.tar.gz libtasn1-2ac0d04b5f8571866e729e9d816ea69780892634.tar.bz2 libtasn1-2ac0d04b5f8571866e729e9d816ea69780892634.zip |
some simplifications in time handling
Diffstat (limited to 'lib/int.h')
-rw-r--r-- | lib/int.h | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -170,5 +170,21 @@ unsigned int type = ntype & 0xff; return type; } +/* To convert old types from a static structure */ +inline static unsigned int convert_old_type(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 | ((ntype>>8)<<8); + } + else + return ntype; +} #endif /* INT_H */ |