Make git_credtype_t a bitfield#1853
Conversation
|
Why add We should probably just remove |
|
At first I was like "let's remove it, it's undocumented", and then I was like "let's keep it, it can be useful" ;-). I'm adding So (for me at least), that's a realistic use case, and if there's interest I can try and make documentation clearer on what's expected (as well as an example, if necessary, but that'll take me near Keychain.framework which isn't the nicest API to use...) |
|
If you're going to use the name to describe what it does rather than the name of the libssh2 functionality, then go all the way, but it's going to stay libssh2-speicific, so I don't quite see the advanteage of naming it something slightly different from its libssh2 name. But the name of this value isn't so important because it doesn't describe a value that a user would see. Which way the signature happens are not different supported authentication mechanisms, so it's only going to be kept inside the I don't see each user doing their own cryptographic signature function as a realistic use-case. Does that Keychain.framework provide you with such a function that you can use on the data? Is there anything on iOS that actually does git stuff? All I hear are people who seem excited that this would even be possible, but no-one seems to actually use it. |
|
I'm speaking of "realistic use case" here, but I don't actually need it right now (the other method taking key files is sufficient for what I'm doing — unrealistic tests of credential functionality).
I'm not sure what
Sorry, I don't get it... The handful of clients written by developers that use Your call on tearing down |
|
@carlosmn @tiennou - I am developing an iOS app on top of libgit2/ObjectiveGit that needs to authenticate with SSH. I was thinking about using @tiennou - do you think writing the keys from the Keychain to temporary files would be a bad idea from a security point of view? |
|
(Sorry, accidentally clicked commit while trying to dismiss the @ menu). @isaac you can take a look at libgit2/objective-git#254, specifically this commit. I haven't been able to test it because I'm on OS X and SSH handles my keys (so I'm using About the security issue, doing what you propose is the only way to authenticate SSH using
EDIT: Looks like iOS keychain API is pretty much toned down. So you'll have to cheat and store the key in a password, so you don't really care about saving unpassworded keys, you don't have any other way. HTH. |
|
@tiennou - thanks! I should have some time to test it out this weekend. |
Hopefully it clears up what is expected from users of `git_cred_ssh_publickey_new`
|
Force-pushed to remove the |
There was a problem hiding this comment.
/** */ to make a documentation comment.
|
Closed via #1903. |
This gives
git_credtype_tcorrect values for or-ing.Right now client code would get
GIT_CREDTYPE_SSH_PUBLICKEY(3) forGIT_CREDTYPE_USERPASS_PLAINTEXT|GIT_CREDTYPE_SSH_KEYFILE_PASSPHRASE(1|2), which would throw them into trying to understand howgit_cred_ssh_publickey_newis to be used ;-).Fixes #1852.