1*bc5531deSDag-Erling Smørgrav /* $OpenBSD: authfd.h,v 1.38 2015/01/14 20:05:27 djm Exp $ */ 2ae1f160dSDag-Erling Smørgrav 3511b41d2SMark Murray /* 4511b41d2SMark Murray * Author: Tatu Ylonen <ylo@cs.hut.fi> 5511b41d2SMark Murray * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 6511b41d2SMark Murray * All rights reserved 7511b41d2SMark Murray * Functions to interface with the SSH_AUTHENTICATION_FD socket. 8511b41d2SMark Murray * 9b66f2d16SKris Kennaway * As far as I am concerned, the code I have written for this software 10b66f2d16SKris Kennaway * can be used freely for any purpose. Any derived versions of this 11b66f2d16SKris Kennaway * software must be clearly marked as such, and if the derived work is 12b66f2d16SKris Kennaway * incompatible with the protocol description in the RFC file, it must be 13b66f2d16SKris Kennaway * called by a name other than "ssh" or "Secure Shell". 14511b41d2SMark Murray */ 15511b41d2SMark Murray 16511b41d2SMark Murray #ifndef AUTHFD_H 17511b41d2SMark Murray #define AUTHFD_H 18511b41d2SMark Murray 19*bc5531deSDag-Erling Smørgrav /* List of identities returned by ssh_fetch_identitylist() */ 20*bc5531deSDag-Erling Smørgrav struct ssh_identitylist { 21*bc5531deSDag-Erling Smørgrav size_t nkeys; 22*bc5531deSDag-Erling Smørgrav struct sshkey **keys; 23*bc5531deSDag-Erling Smørgrav char **comments; 24*bc5531deSDag-Erling Smørgrav }; 25*bc5531deSDag-Erling Smørgrav 26*bc5531deSDag-Erling Smørgrav int ssh_get_authentication_socket(int *fdp); 27*bc5531deSDag-Erling Smørgrav void ssh_close_authentication_socket(int sock); 28*bc5531deSDag-Erling Smørgrav 29*bc5531deSDag-Erling Smørgrav int ssh_lock_agent(int sock, int lock, const char *password); 30*bc5531deSDag-Erling Smørgrav int ssh_fetch_identitylist(int sock, int version, 31*bc5531deSDag-Erling Smørgrav struct ssh_identitylist **idlp); 32*bc5531deSDag-Erling Smørgrav void ssh_free_identitylist(struct ssh_identitylist *idl); 33*bc5531deSDag-Erling Smørgrav int ssh_add_identity_constrained(int sock, struct sshkey *key, 34*bc5531deSDag-Erling Smørgrav const char *comment, u_int life, u_int confirm); 35*bc5531deSDag-Erling Smørgrav int ssh_remove_identity(int sock, struct sshkey *key); 36*bc5531deSDag-Erling Smørgrav int ssh_update_card(int sock, int add, const char *reader_id, 37*bc5531deSDag-Erling Smørgrav const char *pin, u_int life, u_int confirm); 38*bc5531deSDag-Erling Smørgrav int ssh_remove_all_identities(int sock, int version); 39*bc5531deSDag-Erling Smørgrav 40*bc5531deSDag-Erling Smørgrav int ssh_decrypt_challenge(int sock, struct sshkey* key, BIGNUM *challenge, 41*bc5531deSDag-Erling Smørgrav u_char session_id[16], u_char response[16]); 42*bc5531deSDag-Erling Smørgrav int ssh_agent_sign(int sock, struct sshkey *key, 43*bc5531deSDag-Erling Smørgrav u_char **sigp, size_t *lenp, 44*bc5531deSDag-Erling Smørgrav const u_char *data, size_t datalen, u_int compat); 45*bc5531deSDag-Erling Smørgrav 46511b41d2SMark Murray /* Messages for the authentication agent connection. */ 47511b41d2SMark Murray #define SSH_AGENTC_REQUEST_RSA_IDENTITIES 1 48511b41d2SMark Murray #define SSH_AGENT_RSA_IDENTITIES_ANSWER 2 49511b41d2SMark Murray #define SSH_AGENTC_RSA_CHALLENGE 3 50511b41d2SMark Murray #define SSH_AGENT_RSA_RESPONSE 4 51511b41d2SMark Murray #define SSH_AGENT_FAILURE 5 52511b41d2SMark Murray #define SSH_AGENT_SUCCESS 6 53511b41d2SMark Murray #define SSH_AGENTC_ADD_RSA_IDENTITY 7 54511b41d2SMark Murray #define SSH_AGENTC_REMOVE_RSA_IDENTITY 8 55511b41d2SMark Murray #define SSH_AGENTC_REMOVE_ALL_RSA_IDENTITIES 9 56511b41d2SMark Murray 575b9b2fafSBrian Feldman /* private OpenSSH extensions for SSH2 */ 58b66f2d16SKris Kennaway #define SSH2_AGENTC_REQUEST_IDENTITIES 11 59b66f2d16SKris Kennaway #define SSH2_AGENT_IDENTITIES_ANSWER 12 60b66f2d16SKris Kennaway #define SSH2_AGENTC_SIGN_REQUEST 13 61b66f2d16SKris Kennaway #define SSH2_AGENT_SIGN_RESPONSE 14 62b66f2d16SKris Kennaway #define SSH2_AGENTC_ADD_IDENTITY 17 63b66f2d16SKris Kennaway #define SSH2_AGENTC_REMOVE_IDENTITY 18 64b66f2d16SKris Kennaway #define SSH2_AGENTC_REMOVE_ALL_IDENTITIES 19 65b66f2d16SKris Kennaway 66ae1f160dSDag-Erling Smørgrav /* smartcard */ 67ae1f160dSDag-Erling Smørgrav #define SSH_AGENTC_ADD_SMARTCARD_KEY 20 68ae1f160dSDag-Erling Smørgrav #define SSH_AGENTC_REMOVE_SMARTCARD_KEY 21 69ae1f160dSDag-Erling Smørgrav 70545d5ecaSDag-Erling Smørgrav /* lock/unlock the agent */ 71545d5ecaSDag-Erling Smørgrav #define SSH_AGENTC_LOCK 22 72545d5ecaSDag-Erling Smørgrav #define SSH_AGENTC_UNLOCK 23 73545d5ecaSDag-Erling Smørgrav 74545d5ecaSDag-Erling Smørgrav /* add key with constraints */ 75545d5ecaSDag-Erling Smørgrav #define SSH_AGENTC_ADD_RSA_ID_CONSTRAINED 24 76545d5ecaSDag-Erling Smørgrav #define SSH2_AGENTC_ADD_ID_CONSTRAINED 25 77d95e11bfSDag-Erling Smørgrav #define SSH_AGENTC_ADD_SMARTCARD_KEY_CONSTRAINED 26 78545d5ecaSDag-Erling Smørgrav 79545d5ecaSDag-Erling Smørgrav #define SSH_AGENT_CONSTRAIN_LIFETIME 1 80d0c8c0bcSDag-Erling Smørgrav #define SSH_AGENT_CONSTRAIN_CONFIRM 2 81545d5ecaSDag-Erling Smørgrav 82ae1f160dSDag-Erling Smørgrav /* extended failure messages */ 83ae1f160dSDag-Erling Smørgrav #define SSH2_AGENT_FAILURE 30 84ae1f160dSDag-Erling Smørgrav 855b9b2fafSBrian Feldman /* additional error code for ssh.com's ssh-agent2 */ 865b9b2fafSBrian Feldman #define SSH_COM_AGENT2_FAILURE 102 875b9b2fafSBrian Feldman 885b9b2fafSBrian Feldman #define SSH_AGENT_OLD_SIGNATURE 0x01 895b9b2fafSBrian Feldman 90511b41d2SMark Murray #endif /* AUTHFD_H */ 91