[Openswan dev] ARM unaligned bug

Paul Wouters paul at xelerance.com
Thu Jan 21 18:18:13 EST 2010


On Thu, 21 Jan 2010, D. Hugh Redelmeier wrote:

> | #define NSIZEOF_isakmp_hdr      20
> |
> | to
> |
> | #define NSIZEOF_isakmp_hdr      28
> |
> | This works for the ARMs, but I don't know about other architectures.
>
> Oops.  I read the size off a diagram in packet.h.  But the diagram
> wasn't to scale.  Cookies are 8 bytes, not 4.  So I was off by 8.

I'll redo my tests as well.

> | passert(pl[NOFFSETOF_isag_np] == ISAKMP_NEXT_NONE);
> |
> | When I come to this line pl has the hex values: 0D 00 00 14,
> | ISAKMP_NEXT_NONE is defined to 0. But 0xd is ISAKMP_NEXT_VID if I
> | understand correctly. I am not familiar with the protocol, but that is
> | what the debugger says.
> |
> | If VID is optional (I'm speculating here), maybe this line could do:
> | passert(pl[NOFFSETOF_isag_np] == ISAKMP_NEXT_NONE ||
> | pl[NOFFSETOF_isag_np] == ISAKMP_NEXT_VID);
>
> Interesting.
>
> I added the asserts because I thought those conditions would be true,
> not because I knew them to be true :-)

I do not think we are guaranteed that the the current payload is the
last one. So it seems that the passert should allow either ISAKMP_NEXT_NONE
(if our current payload will be the last one) or ISAKMP_NEXT_VID (if we're
doing another payload after this one)

Paul


More information about the Dev mailing list