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

Re: Length field and ISAKMP-encrypted size



John Burke wrote:
> I have not seen it mentioned in discussion and I believe it is nowhere
> mentioned in the drafts, what the state of affairs is if encryption on the
> ISAKMP SA causes expansion.

While not explicitly mentioned, the IPsec DOI mandates the ISAKMP/Oakley 
resolution document which lists valid encryption options for the ISAKMP SA.
All are in CBC mode which basically means packet expansion.

> I also believe ISAKMP presently requires the messages can be of unrounded
> size, since some payloads are defined of arbitrary length; therefore
> necessarily multi-byte encryptions can expand an ISAKMP message.
> 
> IT seems that necessarily, encryption can expand the size of an ISAKMP
> message, but the Message Length field of the ISAKMP header must retain the
> original length of the unencrypted message.  Therefore one must accept and
> decrypt a received packet of length larger than described by the header
> Message Length, up to the rounding required by the encryption method.
> 
> Can an authoritative person please confirm this rumor?  If this is not the
> desired state of affairs, there needs to be clarification, and, I believe,
> updates to the ISAKMP draft?

The free cisco ISAKMP implementation (point your favorite browser to 
http://www.cisco.com/public/library/isakmp.html and follow the hotlinks)
pads the plaintext to the block length of the cipher-- which in this case 
is 64 because it only does DES-- before encrypting. The message length in 
the ISAKMP header of an encrypted message *does* include the pad. After 
decrypting the message I run a sanity check on the entire payload to make 
sure that payloads are internally and globally consistant: attributes of a 
SA payload don't add up to more than the total length of the SA payload and 
all the payload lengths added don't exceed the total message length. If it's 
less (which it would be if the message was encrypted) I don't view it as a 
problem. It would seem to me to be more of a problem if the message was
actually longer than the stated length.

  Yes, you're right, this might need to be spelled out explicitly.

  Dan.



References: