James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx> wrote: > > I wonder if it's worth appending a note to the comment that if > > indefinite length encoding is selected, then the result is not DER- > > compliant and may not be CER-compliant since you're advertising > > BER/DER/CER. > > We only encode definite length currently, so the comment is superfluous > (and probably confusing if you don't know the difference between > DER/BER and CER). Let's add something like this iff we ever start to > use indefinite lengths in the encoder. Your code appears to actually do indefinite length encoding if -1 is passed as len to asn1_encode_tag(). The kdoc says: To encode in place pass a NULL @string and -1 for @len; all this will do is add an indefinite length tag and update the data pointer to the place where the tag contents should be placed. Granted, your patches might not use it, but you're making a generic ASN.1 encoder library. David