Page MenuHomeFreeBSD

Use zfree() to explicitly zero IPsec keys.
ClosedPublic

Authored by jhb on Thu, Jun 25, 12:42 AM.

Details

Test Plan
  • tested with IPsec tunnels over IPv4 (AES-CBC + SHA1 and AES-GCM) and IPv6 (AES-GCM) and using setkey -F to clear state after

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhb created this revision.Thu, Jun 25, 12:42 AM
jhb requested review of this revision.Thu, Jun 25, 12:42 AM
cem resigned from this revision.Thu, Jun 25, 12:44 AM

No interest in ipsec.

delphij accepted this revision.Thu, Jun 25, 4:36 AM

I think setting tdb_xform to NULL is no longer needed (as they are about to be done by the caller anyway).

sys/netipsec/xform_ah.c
256 ↗(On Diff #73614)

Looks like this is redundant too? (Already done by caller, key_cleansav).

sys/netipsec/xform_esp.c
250 ↗(On Diff #73614)

Looks like this is redundant too? (Already done by caller, key_cleansav).

sys/netipsec/xform_tcp.c
368 ↗(On Diff #73614)

Looks like this is redundant too? (Already done by caller, key_cleansav).

This revision is now accepted and ready to land.Thu, Jun 25, 4:36 AM
jhb added a comment.Thu, Jun 25, 8:27 PM

I think setting tdb_xform to NULL is no longer needed (as they are about to be done by the caller anyway).

Yes, I removed those in the followup change. Here I was trying to just focus on the key zeroing via zfree separate from the other change.

This revision was automatically updated to reflect the committed changes.