Skip to content

Conversation

@giga1699
Copy link
Contributor

@giga1699 giga1699 commented Jan 2, 2026

Change summary

Adds support for IKEv2 post-quantum preshared keys

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

https://vyos.dev/T8136

Related PR(s)

vyos/vyos-documentation#1733

How to test / Smoketest result

test_site_to_site_nist_800_77_cnsa_1_with_ppk (__main__.TestVPNIPsec.test_site_to_site_nist_800_77_cnsa_1_with_ppk) ... ok

----------------------------------------------------------------------
Ran 1 test in 3.671s

OK

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@github-actions
Copy link

github-actions bot commented Jan 2, 2026

👍
No issues in PR Title / Commit Title

Copy link
Member

@sarthurdev sarthurdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good, can you extend ipsec smoketests for the new use cases?

@giga1699
Copy link
Contributor Author

giga1699 commented Jan 3, 2026

I was going to make an attempt to write a smoke test. It’ll be my first run at writing a smoketest.

I have already tested against known working strongSwan configs. I’ll take those tests to put into smoketest and update.

I’m also planning to put together the documentation PR. Just haven’t gotten to that yet.

I’ll update the initial PR comment to reflect these updates when complete, and take this out of draft.

@giga1699 giga1699 marked this pull request as ready for review January 3, 2026 20:27
@giga1699
Copy link
Contributor Author

giga1699 commented Jan 3, 2026

Added relevant smoketest, and completed documentation update. I think this should be ready to go.

@giga1699 giga1699 requested a review from sarthurdev January 9, 2026 01:46
Copy link
Member

@sarthurdev sarthurdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the smoketest.

Just needs couple extra steps for config validation and XML deduplication.

@giga1699
Copy link
Contributor Author

Much appreciated for catching those items. It got me thinking about some additional error checking.

I added in that PPK IDs need to be unique, so it now checks that all IDs are unique. Since I had to gather all the IDs for that check, the verify() also confirms that a PPK ID used in a connection is actually defined in the authentication config.

It might be useful to replicate that check for PSKs. I'm happy to open a new task and take care of that if it would be helpful.

Branch was also rebased to current.

@giga1699 giga1699 requested a review from sarthurdev January 10, 2026 00:41
Comment on lines 277 to 279
for ppkID in ppk_config['id']:
if ppkID in ppk_ids:
raise ConfigError(f'Authentication PPK "{ppk}" has duplicate ID "{ppkID}" from another PPK. IDs should be unique.')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my testing if you use the same ID for multiple PPKs, it seems like strongSwan will only use the last loaded PPK for that ID. That is why I put in a check. The ID needs not be an IP address, it is a string that is passed in the IKE phase 1 to let the other side know I'm using key XX. If the receiving side has a key with that same key ID, then it will use that secret to try and establish the SA.

@giga1699
Copy link
Contributor Author

Removed the check in the connection configurations to confirm that a PPK ID was defined in the authentication configuration. This allows an operator to define a wildcard match for the PPK ID, as referenced in the strongSwan example PPK configuration.

Copy link
Member

@sever-sever sever-sever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the ability to use PPK ID and secrets for IPsec connections

@giga1699 giga1699 force-pushed the T8136 branch 2 times, most recently from 117394b to a641609 Compare January 13, 2026 02:22
Copy link
Contributor

@alexandr-san4ez alexandr-san4ez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also fix linter errors for your changes.

Copy link
Contributor

@alexandr-san4ez alexandr-san4ez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Post-quantum preshared key support well implemented and ready to merge.

vyos@vyos:~$ /usr/libexec/vyos/tests/smoke/cli/test_vpn_ipsec.py
...
test_site_to_site_nist_800_77_cnsa_1_with_ppk (__main__.TestVPNIPsec.test_site_to_site_nist_800_77_cnsa_1_with_ppk) ... ok
...
----------------------------------------------------------------------
Ran 20 tests in 101.409s
OK

@github-actions
Copy link

CI integration 👍 passed!

Details

CI logs

  • CLI Smoketests 👍 passed
  • CLI Smoketests (interfaces only) 👍 passed
  • Config tests 👍 passed
  • RAID1 tests 👍 passed
  • CLI Smoketests VPP 👍 passed
  • Config tests VPP 👍 passed
  • TPM tests 👍 passed

@sever-sever sever-sever requested a review from zdc January 13, 2026 12:26
Copy link
Member

@sarthurdev sarthurdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested changes addressed, code looks good, adds smoketest coverage. Locally verified CLI and resulting strongswan config/instance.

@sever-sever sever-sever added the bp/circinus Create automatic backport for circinus label Jan 20, 2026
Copy link
Member

@dmbaturin dmbaturin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation seems sensible but I left a few suggestions.

<!-- include start from ipsec/childless.xml.i -->
<leafNode name="childless">
<properties>
<help>Enable support for childless IKE_SA initiation</help>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<help>Enable support for childless IKE_SA initiation</help>
<help>Enable support for childless IKE SA initiation</help>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there should be an underscore here, just a space.

</completionHelp>
<valueHelp>
<format>allow</format>
<description>Responder will allow childless IKE_SA, but initiator will not create childless connection</description>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<description>Responder will allow childless IKE_SA, but initiator will not create childless connection</description>
<description>Responder will allow childless IKE SA, but initiator will not create childless connections</description>

</valueHelp>
<valueHelp>
<format>prefer</format>
<description>Responder will allow childless IKE_SA, and initiator will make childless connection if supported by responder</description>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<description>Responder will allow childless IKE_SA, and initiator will make childless connection if supported by responder</description>
<description>Responder will allow childless IKE SA, and initiator will make childless connections if supported by responder</description>

</valueHelp>
<valueHelp>
<format>force</format>
<description>Require the use of childless IKE_SA</description>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<description>Require the use of childless IKE_SA</description>
<description>Require the use of childless IKE SA</description>

</valueHelp>
<valueHelp>
<format>never</format>
<description>Disable support for childless IKE_SAs as responder</description>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<description>Disable support for childless IKE_SAs as responder</description>
<description>Disable support for childless IKE SAs as responder</description>

ike = ra_conf['ike_group']
if dict_search(f'ike_group.{ike}.key_exchange', ipsec) != 'ikev2':
raise ConfigError(
f'Post-quantum preshared keys must be used with IKEv2! IKEv2 key-exchange not set in ike-group "{ike}".'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f'Post-quantum preshared keys must be used with IKEv2! IKEv2 key-exchange not set in ike-group "{ike}".'
f'Incorrect configuration in IKE group "{ike}": post-quantum pre-shared keys are not supported for IKEv1.'

ike = ra_conf['ike_group']
if dict_search(f'ike_group.{ike}.key_exchange', ipsec) != 'ikev2':
raise ConfigError(
f'Childless IKE SAs be used with IKEv2! IKEv2 key-exchange not set in ike-group "{ike}".'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f'Childless IKE SAs be used with IKEv2! IKEv2 key-exchange not set in ike-group "{ike}".'
f'Incorrect configuration in IKE group "{ike}": childless IKE SAs can only be used with IKEv2.'

ike = peer_conf['ike_group']
if dict_search(f'ike_group.{ike}.key_exchange', ipsec) != 'ikev2':
raise ConfigError(
f'Post-quantum preshared keys must be used with IKEv2! IKEv2 key-exchange not set in ike-group "{ike}".'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually need this error at all? IKEv2 is enabled by default, so it will be fine for initiating connections. Not setting key exchange to IKEv2 explicitly will enable the peer to respond to IKEv1 connections, but will that not fail automatically if the local side demands post-quantum key exchange?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bp/circinus Create automatic backport for circinus current

Development

Successfully merging this pull request may close these issues.

5 participants