> Yes thats something I'm considering for the ASN1 revision. Something
> like saving the lengths when the length is calculated and then using
> them when the stuff is written out.
Maybe one could cache the length in the ASN1 object. As long as any object
is only used once, this might work.
>
> However that's currently tricky because you'd have to add something like
> a 'ASN1_CTX' parameter with the cached lengths somewhere. Painful with
> the current spaghetti ASN1. Much easier when it all goes through a
> common routine.
Yes, openssl was probably not thought as a general asn1 tool anyway,
but it isn't that bad.
If one decides the object structure, it might be useful to add a flag to
whether the data should be freed when free is called, this would also
avoid copying larger string buffers in some cases, especially
when they could be static somewhere.
>
> > I also remember another encoder that encoding in an inverted way
> > from the end of the buffer after estimation of the length. No
> > performance figures here.
> >
>
> Yes I believe SNACC does that? The only difficulty with that is it makes
> in much harder to write the encoded ASN1 to a stream if you use
> indefinite length encoding.
If you write BER, you don't have exactly the same problems as with DER.
btw: That wasn't snacc, that was some code written in pascal
about 15 years ago. Not one that was publicly available as far as
I know unless Manfred corrects me.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]