|
From: | oriol caño |
Subject: | Re: Der encoding problem |
Date: | Wed, 10 Feb 2016 16:21:33 +0100 |
- Structure printed with the asn1_print_structure function, just before calling the first asn1_der_coding function:Oriol CañoThanks in advance for your help.Any way of fixing it?Do you have any ideas on why could this be happening?The encoding is truncated after a bit string sequence, concretely, the one named kdc-options.I'll append the whole structure at the end of this message.When I call the coding function first, it returns me the length needed to encode the whole structure. However, after calling the function the second time with a buffer of the correct size, it only outputs a buffer with barely one quarter of the total size.However, after creating the correct structure, and calling the asn1_der_coding function twice, as I saw in some code from the library itself, it only encodes a part of the message, and not all of it.Hello all,I am using the libtasn1 library API to DER-encode a message.
name:NULL type:SEQUENCE attr:TAG,
name:NULL type:TAG value:10 attr:APPLICATION,EXPLICIT,
name:pvno type:INTEGER value:0x05 attr:TAG,
name:NULL type:TAG value:1 attr:EXPLICIT,
name:msg-type type:INTEGER value:0x0a attr:TAG,
name:NULL type:TAG value:2 attr:EXPLICIT,
name:padata type:SEQ_OF attr:TAG,OPTION,
name:NULL type:TAG value:3 attr:EXPLICIT,
name:NULL type:SEQUENCE
name:padata-type type:INTEGER attr:TAG,MIN_MAX,
name:NULL type:TAG value:1 attr:EXPLICIT,
name:-2147483648 type:SIZE value:2147483647
name:padata-value type:OCT_STR attr:TAG,
name:NULL type:TAG value:2 attr:EXPLICIT,
name:?1 type:SEQUENCE
name:padata-type type:INTEGER value:0x1c attr:TAG,MIN_MAX,
name:NULL type:TAG value:1 attr:EXPLICIT,
name:-2147483648 type:SIZE value:2147483647
name:padata-value type:OCT_STR value:70612d6b786f766572 attr:TAG,
name:NULL type:TAG value:2 attr:EXPLICIT,
name:?2 type:SEQUENCE
name:padata-type type:INTEGER value:0x10 attr:TAG,MIN_MAX,
name:NULL type:TAG value:1 attr:EXPLICIT,
name:-2147483648 type:SIZE value:2147483647
name:padata-value type:OCT_STR value:300a800830150609 attr:TAG,
name:NULL type:TAG value:2 attr:EXPLICIT,
name:req-body type:SEQUENCE attr:TAG,
name:NULL type:TAG value:4 attr:EXPLICIT,
name:kdc-options type:BIT_STR value(32):00000000 attr:TAG,SIZE,
name:NULL type:TAG value:0 attr:EXPLICIT,
name:cname type:SEQUENCE attr:TAG,OPTION,
name:NULL type:TAG value:1 attr:EXPLICIT,
name:name-type type:INTEGER value:0x02 attr:TAG,MIN_MAX,
name:NULL type:TAG value:0 attr:EXPLICIT,
name:-2147483648 type:SIZE value:2147483647
name:name-string type:SEQ_OF attr:TAG,
name:NULL type:TAG value:1 attr:EXPLICIT,
name:NULL type:GENERALSTRING
name:?1 type:GENERALSTRING value:address@hidden
name:realm type:GENERALSTRING value:SOAD.DEV.ARPA2.ORG attr:TAG,
name:NULL type:TAG value:2 attr:EXPLICIT,
name:sname type:SEQUENCE attr:TAG,OPTION,
name:NULL type:TAG value:3 attr:EXPLICIT,
name:name-type type:INTEGER value:0x02 attr:TAG,MIN_MAX,
name:NULL type:TAG value:0 attr:EXPLICIT,
name:-2147483648 type:SIZE value:2147483647
name:name-string type:SEQ_OF attr:TAG,
name:NULL type:TAG value:1 attr:EXPLICIT,
name:NULL type:GENERALSTRING
name:?1 type:GENERALSTRING value:address@hidden
name:from type:GENERALIZED_TIME value:20160310110054 attr:TAG,OPTION,
name:NULL type:TAG value:4 attr:EXPLICIT,
name:till type:GENERALIZED_TIME value:20160310110054 attr:TAG,
name:NULL type:TAG value:5 attr:EXPLICIT,
name:nonce type:INTEGER value:0x6b8b4567 attr:TAG,MIN_MAX,
name:NULL type:TAG value:7 attr:EXPLICIT,
name:0 type:SIZE value:4294967295
name:etype type:SEQ_OF attr:TAG,
name:NULL type:TAG value:8 attr:EXPLICIT,
name:NULL type:INTEGER attr:MIN_MAX,
name:-2147483648 type:SIZE value:2147483647
name:?1 type:INTEGER value:0x0b attr:MIN_MAX,
name:-2147483648 type:SIZE value:2147483647
[Prev in Thread] | Current Thread | [Next in Thread] |