Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoadKeys() use env + slog.Debug + refactor #24

Merged
merged 3 commits into from
Oct 19, 2023

Conversation

jtagcat
Copy link
Contributor

@jtagcat jtagcat commented Oct 14, 2023

No description provided.

@jtagcat jtagcat temporarily deployed to Build, sign, release binaries October 14, 2023 13:19 — with GitHub Actions Inactive
@jtagcat jtagcat temporarily deployed to Build, sign, release binaries October 14, 2023 13:19 — with GitHub Actions Inactive
@jtagcat jtagcat temporarily deployed to Build, sign, release binaries October 14, 2023 13:19 — with GitHub Actions Inactive
@jtagcat
Copy link
Contributor Author

jtagcat commented Oct 14, 2023

Continuing discussion from #23:

Refactor: keep functions small1, less nested, and exit early. Named it createListener (not listener, since it would result in variable shadowing). I ended up refactoring the bottom part, since there was a shadowed err in main() 2.

My .ssh directory is a symlink. As there is no apparent reason for avoiding symlinks (neither is there precedent from ssh-agent, etc), I made it follow symlinks.

Turns out ssh-tpm-agent didn't use $SSH_AUTH_SOCK, as specified in the systemd unit, now it does.

The debug statements (and a small refactor in main()) are because it didn't give me any error before. Now I am staring at:
level=DEBUG msg="%s not a TPM sealed key: %v\n" /r/c/ssh/hh-8192_ecdsa.tpm="tpm-ssh: unsupported key type \"TPM EC PRIVATE KEY\" edit: fixed by regenerating keys with trunk, not 0.1.0

Footnotes

  1. Pointing to https://www.youtube.com/watch?v=CFRhGnuXG-4 again makes me feel like a religious follower of CodeAesthetic, but I'm not. It happens the topics they have videos on matches, and are imo good explanations.

  2. Meaning a 2nd error check was checking an error from far above, not the assumed one.

@jtagcat jtagcat temporarily deployed to Build, sign, release binaries October 14, 2023 13:50 — with GitHub Actions Inactive
@jtagcat jtagcat temporarily deployed to Build, sign, release binaries October 14, 2023 13:50 — with GitHub Actions Inactive
@jtagcat jtagcat temporarily deployed to Build, sign, release binaries October 14, 2023 13:50 — with GitHub Actions Inactive
@jtagcat jtagcat force-pushed the symlink branch 2 times, most recently from 928a4f0 to cff1384 Compare October 16, 2023 01:26
@jtagcat jtagcat temporarily deployed to Build, sign, release binaries October 16, 2023 01:26 — with GitHub Actions Inactive
@jtagcat jtagcat temporarily deployed to Build, sign, release binaries October 16, 2023 01:26 — with GitHub Actions Inactive
@jtagcat jtagcat temporarily deployed to Build, sign, release binaries October 16, 2023 01:26 — with GitHub Actions Inactive
@jtagcat
Copy link
Contributor Author

jtagcat commented Oct 16, 2023

Resolved conflicts + squashed the linter fix to first commit.

when it is not 5am, i might add context to commits as well 😎 'trying to get it working by understanding it and by understanding, changing it'

@jtagcat jtagcat temporarily deployed to Build, sign, release binaries October 16, 2023 01:28 — with GitHub Actions Inactive
@jtagcat jtagcat temporarily deployed to Build, sign, release binaries October 16, 2023 01:28 — with GitHub Actions Inactive
@jtagcat jtagcat temporarily deployed to Build, sign, release binaries October 16, 2023 01:28 — with GitHub Actions Inactive
@Foxboron Foxboron merged commit 25e8edb into Foxboron:master Oct 19, 2023
5 checks passed
@jtagcat jtagcat deleted the symlink branch October 23, 2023 06:27
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.

None yet

2 participants