Page MenuHomePhabricator

Should we duplicate the sshkey when we use SSH_BIND_OPTIONS_IMPORT_KEY?
Closed, ResolvedPublic

Description

Should we duplicate the sshkey when we use SSH_BIND_OPTIONS_IMPORT_KEY?
if we do not , when we free the bind ,the key which is not generate by this function will be freeed,if the key is used by other place it may causes some Unexpected problems

thanks

Event Timeline

Jakuje added a subscriber: Jakuje.Dec 15 2019, 10:22 AM

The ssh_bind_options_set() does not duplicate the ssh_key structure as the server host key should not really be used for anything else than server key in normal use cases. Where else would you like to use the ssh server private key and what for?

If you need this, you can include the pki.h and duplicate the key yourself (or we can move it to API, but I am still not convinced about the use case)

ZhaoGuangYue1986 closed this task as Resolved.Dec 15 2019, 12:16 PM