help-libtasn1
[Top][All Lists]
Advanced

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

How to add optional value to existing structure?


From: Vasiliy Olekhov
Subject: How to add optional value to existing structure?
Date: Mon, 11 Apr 2016 12:51:18 +0300

Hello.

Consider this structure:

-- Test for adding optional value
Test-20160411 { }
DEFINITIONS IMPLICIT TAGS ::=
BEGIN
S ::= SEQUENCE
{
    O [0] IA5String OPTIONAL,
    V IA5String
}
END

I create a blob with filled only 'V' field, save it to file.
Next, I load this blob from file (in another program) and try to
add optional 'O' value to existing structure.
The asn1_write_value call returns ELEMENT_NOT_FOUND error.

I have prepared a minimal test, please take a look.

Is this expected behavior? What is right way to add optional value?
Should I create a new structure and copy it field-wise and add
extra fields?

asn1_copy_node creates a deep copy and does not help here.


regards,
Vasiliy


Attachment: asn1test.tar.bz2
Description: Binary data


reply via email to

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