diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-11-24 18:22:32 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-11-24 18:22:32 +0100 |
commit | 020ed0387e48fedf89224539d10db1bb464bb4a2 (patch) | |
tree | de1039b31f729f1d306fd7573fa68b2206cbe3ee /lib | |
parent | 76c0e3bca289c1001597dd7081e894f860cee0ec (diff) | |
download | libtasn1-020ed0387e48fedf89224539d10db1bb464bb4a2.tar.gz libtasn1-020ed0387e48fedf89224539d10db1bb464bb4a2.tar.bz2 libtasn1-020ed0387e48fedf89224539d10db1bb464bb4a2.zip |
revert to use strlen when writing time values.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/element.c | 5 | ||||
-rw-r--r-- | lib/libtasn1.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/element.c b/lib/element.c index a49758b..763ac58 100644 --- a/lib/element.c +++ b/lib/element.c @@ -500,6 +500,7 @@ asn1_write_value (asn1_node node_root, const char *name, break; case ASN1_ETYPE_UTC_TIME: { + len = _asn1_strlen(value); if (len < 11) return ASN1_VALUE_NOT_VALID; for (k = 0; k < 10; k++) @@ -539,8 +540,8 @@ asn1_write_value (asn1_node node_root, const char *name, } break; case ASN1_ETYPE_GENERALIZED_TIME: - if (value) - _asn1_set_value (node, value, len); + len = _asn1_strlen(value); + _asn1_set_value (node, value, len); break; case ASN1_ETYPE_OCTET_STRING: case ASN1_ETYPE_GENERALSTRING: diff --git a/lib/libtasn1.h b/lib/libtasn1.h index 5b50c47..06474f3 100644 --- a/lib/libtasn1.h +++ b/lib/libtasn1.h @@ -44,7 +44,7 @@ extern "C" { #endif -#define ASN1_VERSION "3.0" +#define ASN1_VERSION "3.1" /*****************************************/ /* Errors returned by libtasn1 functions */ |