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.7-2-ged211d7


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_4.7-2-ged211d7
Date: Fri, 18 Sep 2015 13:49:35 +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=ed211d7c9b6e186106870e24a9e60f9b5b952a03

The branch, master has been updated
       via  ed211d7c9b6e186106870e24a9e60f9b5b952a03 (commit)
       via  5addb300c7388a50c53e801b623901ab03f47efa (commit)
      from  1e3d04bce839540c6a3f8f14c8521d8390042f23 (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 ed211d7c9b6e186106870e24a9e60f9b5b952a03
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Fri Sep 18 15:49:07 2015 +0200

    doc enhanced the asn1Coding example

commit 5addb300c7388a50c53e801b623901ab03f47efa
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Fri Sep 18 15:45:50 2015 +0200

    asn1Coding: Allow handling NULL values

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

Summary of changes:
 doc/libtasn1.texi |   19 ++++++++++++++++---
 src/asn1Coding.c  |    7 ++++++-
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/doc/libtasn1.texi b/doc/libtasn1.texi
index d634fee..7fabd21 100644
--- a/doc/libtasn1.texi
+++ b/doc/libtasn1.texi
@@ -363,15 +363,24 @@ Options:
 For example, consider an ASN.1 definitions file as follows:
 
 @verbatim
-PKIX1 { }
+MYPKIX1 { }
 
 DEFINITIONS IMPLICIT TAGS ::=
 
 BEGIN
 
+OtherStruct := SEQUENCE {
+     x       INTEGER,
+     y       CHOICE {
+         y1 INTEGER,
+         y2 OCTET STRING },
+}
+
 Dss-Sig-Value ::= SEQUENCE {
      r       INTEGER,
-     s       INTEGER
+     s       INTEGER,
+     other   OtherStruct
+     z       INTEGER OPTIONAL,
 }
 
 END
@@ -380,10 +389,14 @@ END
 And a assignments file as follows:
 
 @verbatim
-dp PKIX1.Dss-Sig-Value
+dp MYPKIX1.Dss-Sig-Value
 
 r 42
 s 47
+other.x 66
+other.y y1
+other.y.y1 15
+z (NULL)
 @end verbatim
 
 Running the command below will generate a @file{assign.out} file,
diff --git a/src/asn1Coding.c b/src/asn1Coding.c
index 650e817..d4df593 100644
--- a/src/asn1Coding.c
+++ b/src/asn1Coding.c
@@ -256,7 +256,12 @@ main (int argc, char *argv[])
          asn1_result = asn1_create_element (definitions, value, &structure);
        }
       else
-       asn1_result = asn1_write_value (structure, varName, value, 0);
+        {
+         if (strcmp(value, "(NULL)") == 0)
+           asn1_result = asn1_write_value (structure, varName, NULL, 0);
+         else
+           asn1_result = asn1_write_value (structure, varName, value, 0);
+       }
 
       if (asn1_result != ASN1_SUCCESS)
        {


hooks/post-receive
-- 
GNU libtasn1



reply via email to

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