Bugzilla – Attachment 2417 Details for
Bug 2081
extend the parameters to the AuthorizedKeysCommand
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch adding environment variables to pass key and fingerprint to AuthorizedKeysCommand
openssh-akcenv.diff (text/plain), 2.30 KB, created by
Scott Duckworth
on 2014-03-25 07:03:56 AEDT
(
hide
)
Description:
Patch adding environment variables to pass key and fingerprint to AuthorizedKeysCommand
Filename:
MIME Type:
Creator:
Scott Duckworth
Created:
2014-03-25 07:03:56 AEDT
Size:
2.30 KB
patch
obsolete
>Index: auth2-pubkey.c >=================================================================== >RCS file: /cvs/openssh/auth2-pubkey.c,v >retrieving revision 1.42 >diff -r1.42 auth2-pubkey.c >512c512,513 >< char *username, errmsg[512]; >--- >> long len; >> char *username, *keytext, errmsg[512]; >569a571,607 >> >> keytext = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); >> if (setenv(SSH_KEY_FINGERPRINT_ENV_NAME, keytext, 1) == -1) { >> error("%s: setenv: %s", __func__, strerror(errno)); >> _exit(1); >> } >> >> if ((f = tmpfile()) == NULL) { >> error("%s: tmpfile: %s", __func__, strerror(errno)); >> _exit(1); >> } >> if (!key_write(key, f)) { >> error("%s: key_write: %s", __func__, strerror(errno)); >> _exit(1); >> } >> if ((len = ftell(f)) == -1) { >> error("%s: ftell: %s", __func__, strerror(errno)); >> _exit(1); >> } >> if ((keytext = xmalloc(len + 1)) == NULL) { >> error("%s: xmalloc: %s", __func__, strerror(errno)); >> _exit(1); >> } >> if ((fseek(f, 0, SEEK_SET)) != 0) { >> error("%s: fseek: %s", __func__, strerror(errno)); >> _exit(1); >> } >> if (fread(keytext, 1, len, f) != len) { >> error("%s: fread: %s", __func__, strerror(errno)); >> _exit(1); >> } >> keytext[len] = '\0'; >> fclose(f); >> if (setenv(SSH_KEY_ENV_NAME, keytext, 1) == -1) { >> error("%s: setenv: %s", __func__, strerror(errno)); >> _exit(1); >> } >Index: ssh.h >=================================================================== >RCS file: /cvs/openssh/ssh.h,v >retrieving revision 1.78 >diff -r1.78 ssh.h >99a100,111 >> >> /* >> * Name of the environment variable containing the incoming key passed >> * to AuthorizedKeysCommand. >> */ >> #define SSH_KEY_ENV_NAME "SSH_KEY" >> >> /* >> * Name of the environment variable containing the incoming key fingerprint >> * passed to AuthorizedKeysCommand. >> */ >> #define SSH_KEY_FINGERPRINT_ENV_NAME "SSH_KEY_FINGERPRINT" >Index: sshd_config.5 >=================================================================== >RCS file: /cvs/openssh/sshd_config.5,v >retrieving revision 1.179 >diff -r1.179 sshd_config.5 >205a206,210 >> The key being used for authentication (the key's type and the key text itself, >> separated by a space) will be available in the >> .Ev SSH_KEY >> environment variable, and the fingerprint of the key will be available in the >> .Ev SSH_KEY_FINGERPRINT environment variable.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2081
:
2412
|
2416
|
2417
|
2438
|
2477
|
2478
|
2479
|
2522
|
2544
|
2545
|
2546
|
2549
|
2556
|
2557