-/* crypto/asn1/a_time.c */
/* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
#include <stdio.h>
#include <time.h>
-#include "cryptlib.h"
+#include "internal/cryptlib.h"
#include <openssl/asn1t.h>
#include "asn1_locl.h"
str = (char *)ret->data;
/* Work out the century and prepend */
if (t->data[0] >= '5')
- BUF_strlcpy(str, "19", newlen);
+ OPENSSL_strlcpy(str, "19", newlen);
else
- BUF_strlcpy(str, "20", newlen);
+ OPENSSL_strlcpy(str, "20", newlen);
- BUF_strlcat(str, (char *)t->data, newlen);
+ OPENSSL_strlcat(str, (char *)t->data, newlen);
return ret;
}
return 0;
return OPENSSL_gmtime_diff(pday, psec, &tm_from, &tm_to);
}
+
+int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm)
+{
+ if (tm->type == V_ASN1_UTCTIME)
+ return ASN1_UTCTIME_print(bp, tm);
+ if (tm->type == V_ASN1_GENERALIZEDTIME)
+ return ASN1_GENERALIZEDTIME_print(bp, tm);
+ BIO_write(bp, "Bad time value", 14);
+ return (0);
+}