Main Page | Namespace List | Class List | Directories | File List | Class Members | File Members

authfd.h

Go to the documentation of this file.
00001 /*      $OpenBSD: authfd.h,v 1.34 2003/11/21 11:57:03 djm Exp $ */
00002 
00003 /*
00004  * Author: Tatu Ylonen <ylo@cs.hut.fi>
00005  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
00006  *                    All rights reserved
00007  * Functions to interface with the SSH_AUTHENTICATION_FD socket.
00008  *
00009  * As far as I am concerned, the code I have written for this software
00010  * can be used freely for any purpose.  Any derived versions of this
00011  * software must be clearly marked as such, and if the derived work is
00012  * incompatible with the protocol description in the RFC file, it must be
00013  * called by a name other than "ssh" or "Secure Shell".
00014  */
00015 
00016 #ifndef AUTHFD_H
00017 #define AUTHFD_H
00018 
00019 #include "buffer.h"
00020 
00021 /* Messages for the authentication agent connection. */
00022 #define SSH_AGENTC_REQUEST_RSA_IDENTITIES       1
00023 #define SSH_AGENT_RSA_IDENTITIES_ANSWER         2
00024 #define SSH_AGENTC_RSA_CHALLENGE                3
00025 #define SSH_AGENT_RSA_RESPONSE                  4
00026 #define SSH_AGENT_FAILURE                       5
00027 #define SSH_AGENT_SUCCESS                       6
00028 #define SSH_AGENTC_ADD_RSA_IDENTITY             7
00029 #define SSH_AGENTC_REMOVE_RSA_IDENTITY          8
00030 #define SSH_AGENTC_REMOVE_ALL_RSA_IDENTITIES    9
00031 
00032 /* private OpenSSH extensions for SSH2 */
00033 #define SSH2_AGENTC_REQUEST_IDENTITIES          11
00034 #define SSH2_AGENT_IDENTITIES_ANSWER            12
00035 #define SSH2_AGENTC_SIGN_REQUEST                13
00036 #define SSH2_AGENT_SIGN_RESPONSE                14
00037 #define SSH2_AGENTC_ADD_IDENTITY                17
00038 #define SSH2_AGENTC_REMOVE_IDENTITY             18
00039 #define SSH2_AGENTC_REMOVE_ALL_IDENTITIES       19
00040 
00041 /* smartcard */
00042 #define SSH_AGENTC_ADD_SMARTCARD_KEY            20
00043 #define SSH_AGENTC_REMOVE_SMARTCARD_KEY         21
00044 
00045 /* lock/unlock the agent */
00046 #define SSH_AGENTC_LOCK                         22
00047 #define SSH_AGENTC_UNLOCK                       23
00048 
00049 /* add key with constraints */
00050 #define SSH_AGENTC_ADD_RSA_ID_CONSTRAINED       24
00051 #define SSH2_AGENTC_ADD_ID_CONSTRAINED          25
00052 #define SSH_AGENTC_ADD_SMARTCARD_KEY_CONSTRAINED 26
00053 
00054 #define SSH_AGENT_CONSTRAIN_LIFETIME            1
00055 #define SSH_AGENT_CONSTRAIN_CONFIRM             2
00056 
00057 /* extended failure messages */
00058 #define SSH2_AGENT_FAILURE                      30
00059 
00060 /* additional error code for ssh.com's ssh-agent2 */
00061 #define SSH_COM_AGENT2_FAILURE                  102
00062 
00063 #define SSH_AGENT_OLD_SIGNATURE                 0x01
00064 
00065 typedef struct {
00066         int     fd;
00067         Buffer  identities;
00068         int     howmany;
00069 }       AuthenticationConnection;
00070 
00071 int     ssh_agent_present(void);
00072 int     ssh_get_authentication_socket(void);
00073 void    ssh_close_authentication_socket(int);
00074 
00075 AuthenticationConnection *ssh_get_authentication_connection(void);
00076 void    ssh_close_authentication_connection(AuthenticationConnection *);
00077 int      ssh_get_num_identities(AuthenticationConnection *, int);
00078 Key     *ssh_get_first_identity(AuthenticationConnection *, char **, int);
00079 Key     *ssh_get_next_identity(AuthenticationConnection *, char **, int);
00080 int      ssh_add_identity(AuthenticationConnection *, Key *, const char *);
00081 int      ssh_add_identity_constrained(AuthenticationConnection *, Key *,
00082     const char *, u_int, u_int);
00083 int      ssh_remove_identity(AuthenticationConnection *, Key *);
00084 int      ssh_remove_all_identities(AuthenticationConnection *, int);
00085 int      ssh_lock_agent(AuthenticationConnection *, int, const char *);
00086 int      ssh_update_card(AuthenticationConnection *, int, const char *,
00087     const char *, u_int, u_int);
00088 
00089 int
00090 ssh_decrypt_challenge(AuthenticationConnection *, Key *, BIGNUM *, u_char[16],
00091     u_int, u_char[16]);
00092 
00093 int
00094 ssh_agent_sign(AuthenticationConnection *, Key *, u_char **, u_int *, u_char *,
00095     u_int);
00096 
00097 #endif                          /* AUTHFD_H */

© sourcejam.com 2005-2008