[Swan-dev] Question on get_cookie() code

D. Hugh Redelmeier hugh at mimosa.com
Thu Jan 7 20:34:46 UTC 2016

| From: Paul Wouters <paul at nohats.ca>

| Additionally, since the SPI in IKEv1 and IKEv2 is always 8 octets, all
| callers to this function pass a length of 8, so we might as well phase
| out the argument.

Yes.  Done.

| The while() seems to cover an extremely extremely rare case, which is
| just as rare as generating the same SPI twice, a condition that is never
| checked for.

Right, but a 0 is a disaster and a duplicate is only unfortunate.

| If there is still a reason to keep it, I would like to rename it to
| get_rnd_ikespi() or something, as "cookie" is a misleading term.

I added "v1" to the name.

More information about the Swan-dev mailing list