ietf-openpgp
[Top] [All Lists]

Re: Proposed reason-for-revocation subpacket

1998-06-01 14:13:55
Jon Callas, <jon(_at_)pgp(_dot_)com>, writes:
With counted strings, someone has to go and terminate them anyway, and the
only place where a null-terminated string is specified in the whole draft
is in the regular expression subpacket (and I don't know why it's there). 

The reason I used one there is because the off-the-shelf regexp library
I used took null terminated strings.  I didn't want to go through and
munge it to make it take counted strings, and I didn't want to allocate a
buffer and make a copy so I could null-terminate each regexp as we use it.
It was just a lot simpler to store the null with the string.

With userids it's not so bad because they occupy a whole packet.  I have
to allocate a buffer for them when I read them into memory anyway, so
I allocate one extra byte at the end and put a null in it when I read
the userid.  This insures that the userid packet is followed in memory
by a null byte.

But for subpackets this trick doesn't work, so I put the null in the packet.

Hal