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

Could not read private key from /dev/fd/63 #369

Open
Inveracity opened this issue Jun 10, 2024 · 1 comment
Open

Could not read private key from /dev/fd/63 #369

Inveracity opened this issue Jun 10, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers stale-exempt

Comments

@Inveracity
Copy link

Heya, while attempting to register my runner with an app private key I ran into the following error message:

Could not read private key from /dev/fd/63

I found that I could work around it by making the following change in app_token.sh

+ PRIVATE_KEY_PATH=$1
rsa256_sign() {
+ openssl dgst -binary -sha256 -sign $PRIVATE_KEY_PATH
- openssl dgst -binary -sha256 -sign <(echo "$1")
}

and then run it

bash app_token.sh /path/to/my.pem

If this is a reasonable change I'll submit a PR

Host info:

  • Ubuntu 24.04
  • GNU Bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu)
  • OpenSSL 3.0.13 Jan 2024
@myoung34
Copy link
Owner

myoung34 commented Jun 10, 2024

Good catch, this was missed a long time ago. the current usage is definitely wrong as <() returns a file descriptor and not what was expected. A simple PR should be good enough

however scope the variable:

rsa256_sign() {
 PRIVATE_KEY_PATH=$1
 openssl dgst -binary -sha256 -sign $PRIVATE_KEY_PATH
}

or

rsa256_sign() {
 openssl dgst -binary -sha256 -sign $1
}

@myoung34 myoung34 added enhancement New feature or request good first issue Good for newcomers labels Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers stale-exempt
Projects
None yet
Development

No branches or pull requests

2 participants