I was trying to encode a buffer to ber but I don't know the exact size of the buffer.
I tried doing this
size = der_encode_to_buffer(&asn_DEF_type, struct_ptr, *buffer, 1000).encoded
Assuming that the size of the buffer will be less than 1000
But this way I have to choose a upper limit which is hard to define so I tried this
size = der_encode_to_buffer(&asn_DEF_type, struct_ptr, NULL, 0).encoded
der_encode_to_buffer(&asn_DEF_type, struct_ptr, *buffer, size)
But this is giving error
So is there a way to determine the size of the encoded buffer?