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

yubico-piv-tool directory structure is incompatible with ssh-add -s under OSX 10.12 #16385

Closed
paul-pearce opened this issue Aug 4, 2017 · 13 comments

Comments

@paul-pearce
Copy link

paul-pearce commented Aug 4, 2017

  • "Please always follow these steps"

Steps followed, but the issue is not a formula error. The formula installs correctly.

  • What I'm trying to do:

Use the PKCS11 library provided by yubico-piv-tool to perform:

ssh-add -s /usr/local/lib/libykcs11.dylib

(Perform PKCS#11 operations with an yubikey device.)

  • What happened (only under OSX 10.12):

Could not add card "/usr/local/lib/libykcs11.dylib": agent refused operation

  • What I expect to happen:

Card added: /usr/local/lib/libykcs11.dylib

  • Recreation:
brew install yubico-piv-tool 
# insert yubikey
ssh-add -s /usr/local/lib/libykcs11.dylib

Please see the issue filed here with yubico-piv-tool: Yubico/yubico-piv-tool#118

The core issue is the directory structure of this forumla under 10.12 symlinks:

/usr/local/lib/libykcs11.dylib -> ../Cellar/yubico-piv-tool/1.4.0/lib/libykcs11.dylib

Which is a violation of the OSX 10.12 ssh-agent PKCS_WHITELIST (see man ssh-agent). This whitelist only allows PKCS libraries from within /usr/local/lib and /usr/lib/, and does not allow symlinks.

The fix would be for the formula to copy the library into /usr/local/lib instead of symlinking it. Is that possible? (My brew knowledge is low.)

@ilovezfs
Copy link
Contributor

ilovezfs commented Aug 4, 2017

The fix would be for the formula to copy the library into /usr/local/lib instead of symlinking it. Is that possible? (My brew knowledge is low.)

Not without significant hacking.

     -P pkcs11_whitelist
             Specify a pattern-list of acceptable paths for PKCS#11 shared libraries that may be added using the -s option to ssh-add(1).  The default is to allow loading
             PKCS#11 libraries from ``/usr/lib/*,/usr/local/lib/*''.  PKCS#11 libraries that do not match the whitelist will be refused.  See PATTERNS in ssh_config(5) for a
             description of pattern-list syntax.

This sounds like your best bet.

@paul-pearce
Copy link
Author

@ilovezfs, near as I can tell ssh-agent on 10.12, despite claiming to accept -P (man and -h), does not allow you to specify that argument. It always comes back with illegal option. (And 10.12 protects the existing ssh-agent install and invocation, meaning you can't simply replace the existing agent with a fixed version or updated arguments, you'd have to run a 2nd copy of agent.)

This is reported in other threads (such as OpenSC/OpenSC#1008).

As of now, the only solution I can find involves copying the library into one of the two pre-defined paths.

Is executing a post-install bash script not something brew can easily do?

@stale stale bot added the stale No recent activity label Aug 25, 2017
@stale
Copy link

stale bot commented Aug 25, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@paul-pearce
Copy link
Author

This is still an issue. I replied with further info and am hoping for a response.

@stale stale bot closed this as completed Sep 1, 2017
@paul-pearce
Copy link
Author

What? I clearly added activity? Does your stalebot only consider owner activity as activity? @ilovezfs

@ilovezfs ilovezfs reopened this Sep 28, 2017
@stale stale bot removed the stale No recent activity label Sep 28, 2017
@stale
Copy link

stale bot commented Oct 19, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale No recent activity label Oct 19, 2017
@paul-pearce
Copy link
Author

:( Any progress?

@stale stale bot removed the stale No recent activity label Oct 19, 2017
@stale
Copy link

stale bot commented Nov 9, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale No recent activity label Nov 9, 2017
@paul-pearce
Copy link
Author

My last attempt at reviving this. @ilovezfs?

@stale stale bot removed the stale No recent activity label Nov 9, 2017
@grantho
Copy link

grantho commented Nov 15, 2017

I am also experiencing this as an issue. Is there a plan to resolve it?

@stale
Copy link

stale bot commented Dec 6, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale No recent activity label Dec 6, 2017
@stale stale bot closed this as completed Dec 14, 2017
@ilovezfs ilovezfs reopened this Dec 14, 2017
@stale stale bot removed the stale No recent activity label Dec 14, 2017
@JCount
Copy link
Contributor

JCount commented Dec 15, 2017

If you are using they system install of OpenSSH this might be pertinent: Technical Note TN2449
OpenSSH updates in macOS 10.12.2

@ilovezfs
Copy link
Contributor

@paul-pearce also you may want to try it with brew's openssh and see if you get a different outcome.

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants