Re: [PATCH v8 1/8] lib: add ASN.1 encoder

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

 



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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux