libtasn1-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU libtasn1 branch, master, updated. libtasn1_4_5-6-g1015d1f


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_4_5-6-g1015d1f
Date: Mon, 08 Jun 2015 09:58:23 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU libtasn1".

http://git.savannah.gnu.org/cgit/libtasn1.git/commit/?id=1015d1fd053e4bcc792bb41eca225ef3ccc10fc4

The branch, master has been updated
       via  1015d1fd053e4bcc792bb41eca225ef3ccc10fc4 (commit)
      from  1b852ffe9e806a727b3f4f601cfb2567535b14ec (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 1015d1fd053e4bcc792bb41eca225ef3ccc10fc4
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Mon Jun 8 11:57:21 2015 +0200

    simplified asn1_get_time_der

-----------------------------------------------------------------------

Summary of changes:
 lib/decoding.c |   47 ++++++++++++++++++++++++++++++-----------------
 lib/libtasn1.h |    2 +-
 2 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/lib/decoding.c b/lib/decoding.c
index 55a9b00..bb5f68b 100644
--- a/lib/decoding.c
+++ b/lib/decoding.c
@@ -275,22 +275,13 @@ asn1_get_octet_der (const unsigned char *der, int der_len,
   return ASN1_SUCCESS;
 }
 
-/**
- * asn1_get_time_der:
- * @type: %ASN1_ETYPE_GENERALIZED_TIME or %ASN1_ETYPE_UTC_TIME
- * @der: DER data to decode containing the time
- * @der_len: Length of DER data to decode.
- * @ret_len: Output variable containing the length of the DER data.
- * @str: Pre-allocated output buffer to put the textual time in.
- * @str_size: Length of pre-allocated output buffer.
- * @flags: Zero or %ASN1_DECODE_FLAG_STRICT_DER
- *
- * Converts a DER encoded time object to its textual form.
+
+/* As with asn1_get_time_der().
  *
- * Returns: %ASN1_SUCCESS on success, or an error.
- **/
-int
-asn1_get_time_der (unsigned type, const unsigned char *der, int der_len, int 
*ret_len,
+ * @flags: Zero or %ASN1_DECODE_FLAG_STRICT_DER
+ */
+static int
+_asn1_get_time_der (unsigned type, const unsigned char *der, int der_len, int 
*ret_len,
                    char *str, int str_size, unsigned flags)
 {
   int len_len, str_len;
@@ -340,7 +331,7 @@ asn1_get_time_der (unsigned type, const unsigned char *der, 
int der_len, int *re
                  }
 
                warn();
-           return ASN1_DER_ERROR;
+               return ASN1_DER_ERROR;
              }
          }
 
@@ -358,6 +349,28 @@ asn1_get_time_der (unsigned type, const unsigned char 
*der, int der_len, int *re
 }
 
 /**
+ * asn1_get_time_der:
+ * @type: %ASN1_ETYPE_GENERALIZED_TIME or %ASN1_ETYPE_UTC_TIME
+ * @der: DER data to decode containing the time
+ * @der_len: Length of DER data to decode.
+ * @ret_len: Output variable containing the length of the DER data.
+ * @str: Pre-allocated output buffer to put the textual time in.
+ * @str_size: Length of pre-allocated output buffer.
+ *
+ * Performs basic checks in the DER encoded time object and returns its 
textual form.
+ * The textual form will be in the YYYYMMDD000000Z format for GeneralizedTime
+ * and YYMMDD000000Z for UTCTime.
+ *
+ * Returns: %ASN1_SUCCESS on success, or an error.
+ **/
+int
+asn1_get_time_der (unsigned type, const unsigned char *der, int der_len, int 
*ret_len,
+                  char *str, int str_size)
+{
+       return _asn1_get_time_der(type, der, der_len, ret_len, str, str_size, 
ASN1_DECODE_FLAG_STRICT_DER);
+}
+
+/**
  * asn1_get_objectid_der:
  * @der: DER data to decode containing the OBJECT IDENTIFIER
  * @der_len: Length of DER data to decode.
@@ -1267,7 +1280,7 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, 
int *max_ider_len,
            case ASN1_ETYPE_GENERALIZED_TIME:
            case ASN1_ETYPE_UTC_TIME:
              result =
-               asn1_get_time_der (type_field (p->type), der + counter, 
ider_len, &len2, temp,
+               _asn1_get_time_der (type_field (p->type), der + counter, 
ider_len, &len2, temp,
                                    sizeof (temp) - 1, flags);
              if (result != ASN1_SUCCESS)
                {
diff --git a/lib/libtasn1.h b/lib/libtasn1.h
index 364ce4e..6dcccc6 100644
--- a/lib/libtasn1.h
+++ b/lib/libtasn1.h
@@ -381,7 +381,7 @@ extern "C"
 
   extern ASN1_API int
     asn1_get_time_der (unsigned type, const unsigned char *der, int der_len, 
int *ret_len,
-                      char *str, int str_size, unsigned flags);
+                      char *str, int str_size);
 
 /* Compatibility types */
 


hooks/post-receive
-- 
GNU libtasn1



reply via email to

[Prev in Thread] Current Thread [Next in Thread]