Skip to content

Conversation

@cheina97
Copy link
Member

@cheina97 cheina97 commented Nov 27, 2025

Problem

When establishing peering between clusters, the tenant controller fails with the following error:

failed to parse public key: asn1: structure error: tags don't match (16 vs {class:2 tag:29 length:53 isCompound:false})

Cause

The VerifyNonce and checkCSR functions in the authentication module expected public keys to be strictly in PKIX DER-encoded format. An older version of liqoctl was storing the public key in a different format, causing the ASN.1 parser to fail.

Solution

Added a parsePublicKey helper function that attempts to parse the public key from multiple formats:

  1. First tries PEM decoding (if the data contains a PEM block)
  2. Then tries PKIX DER parsing
  3. Falls back to raw Ed25519 public key (32 bytes)

Updated both VerifyNonce and checkCSR functions to use this flexible parsing approach, ensuring backward compatibility with Tenant resources created by older liqoctl versions.

@adamjensenbot
Copy link
Collaborator

Hi @cheina97. Thanks for your PR!

I am @adamjensenbot.
You can interact with me issuing a slash command in the first line of a comment.
Currently, I understand the following commands:

  • /rebase: Rebase this PR onto the master branch (You can add the option test=true to launch the tests
    when the rebase operation is completed)
  • /merge: Merge this PR into the master branch
  • /build Build Liqo components
  • /test Launch the E2E and Unit tests
  • /hold, /unhold Add/remove the hold label to prevent merging with /merge

Make sure this PR appears in the liqo changelog, adding one of the following labels:

  • feat: 🚀 New Feature
  • fix: 🐛 Bug Fix
  • refactor: 🧹 Code Refactoring
  • docs: 📝 Documentation
  • style: 💄 Code Style
  • perf: 🐎 Performance Improvement
  • test: ✅ Tests
  • chore: 🚚 Dependencies Management
  • build: 📦 Builds Management
  • ci: 👷 CI/CD
  • revert: ⏪ Reverts Previous Changes

@github-actions github-actions bot added the fix Fixes a bug in the codebase. label Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Fixes a bug in the codebase. size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants