Skip to content

plugin: support p256tag#34

Merged
Foxboron merged 14 commits intomasterfrom
morten/p256tag
Dec 25, 2025
Merged

plugin: support p256tag#34
Foxboron merged 14 commits intomasterfrom
morten/p256tag

Conversation

@Foxboron
Copy link
Copy Markdown
Owner

@Foxboron Foxboron commented Dec 10, 2025

This contains a couple of changes.

  • Support the new p256tag
  • Removal of the --swtpm feature
  • A bit of modernizing of ecdh keys

All older keys age!tpm and old stanzas, tpm-ecc, are still supported. But warnings will be printed when people try to use the old style stuff.

See C2SP/C2SP#156

@Foxboron Foxboron had a problem deploying to Build, sign, release binaries December 10, 2025 19:57 — with GitHub Actions Error
@Foxboron Foxboron had a problem deploying to Build, sign, release binaries December 10, 2025 19:57 — with GitHub Actions Error
@Foxboron Foxboron had a problem deploying to Build, sign, release binaries December 10, 2025 19:57 — with GitHub Actions Failure
@Foxboron Foxboron had a problem deploying to Build, sign, release binaries December 10, 2025 22:01 — with GitHub Actions Failure
@Foxboron Foxboron had a problem deploying to Build, sign, release binaries December 10, 2025 22:01 — with GitHub Actions Error
@Foxboron Foxboron had a problem deploying to Build, sign, release binaries December 10, 2025 22:01 — with GitHub Actions Failure
@Foxboron Foxboron had a problem deploying to Build, sign, release binaries December 10, 2025 22:01 — with GitHub Actions Failure
@Foxboron Foxboron had a problem deploying to Build, sign, release binaries December 10, 2025 22:01 — with GitHub Actions Error
@Foxboron Foxboron had a problem deploying to Build, sign, release binaries December 10, 2025 22:01 — with GitHub Actions Failure
@Foxboron Foxboron had a problem deploying to Build, sign, release binaries December 13, 2025 16:05 — with GitHub Actions Error
@Foxboron Foxboron had a problem deploying to Build, sign, release binaries December 13, 2025 16:05 — with GitHub Actions Error
@Foxboron Foxboron had a problem deploying to Build, sign, release binaries December 13, 2025 16:05 — with GitHub Actions Failure
@Foxboron Foxboron had a problem deploying to Build, sign, release binaries December 13, 2025 16:05 — with GitHub Actions Error
@Foxboron Foxboron had a problem deploying to Build, sign, release binaries December 13, 2025 16:05 — with GitHub Actions Error
@Foxboron Foxboron had a problem deploying to Build, sign, release binaries December 13, 2025 16:05 — with GitHub Actions Failure
@Foxboron
Copy link
Copy Markdown
Owner Author

The plain build is going to continue to fail until stuff is properly upstream. But most of the work is completed in the branch.

@FiloSottile
Copy link
Copy Markdown
Contributor

C2SP/C2SP#156 and FiloSottile/age#651 are merged!

@Foxboron
Copy link
Copy Markdown
Owner Author

Christmas came early :) Thanks!

@FiloSottile Do you have any plans on a release soon'ish or is that for next year?

@FiloSottile
Copy link
Copy Markdown
Contributor

You can depend on the current main branch, I might try to merge a couple unrelated backwards-compatible things before cutting a release, but I want to do release and announcement before Christmas (and it would be awesome to have an age-plugin-tpm release to point to!).

@Foxboron
Copy link
Copy Markdown
Owner Author

I'll work towards the main branch. I just wanted to figure out the time-scale for the release so I can have a v1.0.0 release or something similar ready for the age release :)

@Foxboron
Copy link
Copy Markdown
Owner Author

@FiloSottile One question around nistec and ECC key manipulation. The TPM interactions requires me to create keys from the raw X and Y points, as well as access these from public keys.

Since the Go crypto library is deprecating all of this I can't seem to find equivalent code in either x/crypto, crypto nor nistec.

Whats the new strategy for this?

@FiloSottile
Copy link
Copy Markdown
Contributor

The nistec Bytes/SetBytes format is just 0x04 || X || Y, where X and Y are fixed-length big endian.

@Foxboron
Copy link
Copy Markdown
Owner Author

Aha, is there a reason why we can't have easily accessible APIs to retrieve these values?

@FiloSottile
Copy link
Copy Markdown
Contributor

I'm not sure how much easier we can make it. We definitely don't want to import math/big after so much effort pushing it out of the boundary, and big-endian byte slices are the next easiest thing.

I guess we can strip the 0x04 in front and split it in two, but we'd be saving one or two line of code.

@Foxboron
Copy link
Copy Markdown
Owner Author

I'm not sure how much easier we can make it. We definitely don't want to import math/big after so much effort pushing it out of the boundary, and big-endian byte slices are the next easiest thing.

Completely understandable.

I guess we can strip the 0x04 in front and split it in two, but we'd be saving one or two line of code.

As a non-crypto person it just feels very fragile dealing with this myself :)

Thanks!

@FiloSottile
Copy link
Copy Markdown
Contributor

As a non-crypto person it just feels very fragile dealing with this myself :)

Fair, but if you are moving around raw coordinates I do want you to feel a little uncomfortable, because you'd be doing low-level things even if we did have an API making it easier :)

(To be clear, in this case it makes perfect sense you'd need to. You are effectively in charge of doing a format conversion.)

@Foxboron Foxboron temporarily deployed to Build, sign, release binaries December 25, 2025 00:12 — with GitHub Actions Inactive
@Foxboron Foxboron temporarily deployed to Build, sign, release binaries December 25, 2025 00:12 — with GitHub Actions Inactive
@Foxboron Foxboron temporarily deployed to Build, sign, release binaries December 25, 2025 00:12 — with GitHub Actions Inactive
@Foxboron Foxboron temporarily deployed to Build, sign, release binaries December 25, 2025 00:12 — with GitHub Actions Inactive
@Foxboron Foxboron temporarily deployed to Build, sign, release binaries December 25, 2025 00:12 — with GitHub Actions Inactive
@Foxboron Foxboron deployed to Build, sign, release binaries December 25, 2025 00:12 — with GitHub Actions Active
Fixes: #28

Signed-off-by: Morten Linderud <morten@linderud.pw>
Signed-off-by: Morten Linderud <morten@linderud.pw>
Signed-off-by: Morten Linderud <morten@linderud.pw>
Signed-off-by: Morten Linderud <morten@linderud.pw>
Signed-off-by: Morten Linderud <morten@linderud.pw>
…a message

Signed-off-by: Morten Linderud <morten@linderud.pw>
Signed-off-by: Morten Linderud <morten@linderud.pw>
Signed-off-by: Morten Linderud <morten@linderud.pw>
We should gracefully only output the new p256tag.
Warn users when we encounter tpm-ecc stanzas or old-style recipient
files.

Added tests

Signed-off-by: Morten Linderud <morten@linderud.pw>
Signed-off-by: Morten Linderud <morten@linderud.pw>
Remove before age release

Signed-off-by: Morten Linderud <morten@linderud.pw>
Fixes: #26

Signed-off-by: Morten Linderud <morten@linderud.pw>
We do not need to support this anymore

Signed-off-by: Morten Linderud <morten@linderud.pw>
Signed-off-by: Morten Linderud <morten@linderud.pw>
@Foxboron Foxboron merged commit aadb842 into master Dec 25, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants