authfd.h (69587) | authfd.h (76259) |
---|---|
1/* 2 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * All rights reserved 5 * Functions to interface with the SSH_AUTHENTICATION_FD socket. 6 * 7 * As far as I am concerned, the code I have written for this software 8 * can be used freely for any purpose. Any derived versions of this 9 * software must be clearly marked as such, and if the derived work is 10 * incompatible with the protocol description in the RFC file, it must be 11 * called by a name other than "ssh" or "Secure Shell". 12 */ 13 | 1/* 2 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * All rights reserved 5 * Functions to interface with the SSH_AUTHENTICATION_FD socket. 6 * 7 * As far as I am concerned, the code I have written for this software 8 * can be used freely for any purpose. Any derived versions of this 9 * software must be clearly marked as such, and if the derived work is 10 * incompatible with the protocol description in the RFC file, it must be 11 * called by a name other than "ssh" or "Secure Shell". 12 */ 13 |
14/* RCSID("$OpenBSD: authfd.h,v 1.13 2000/10/09 21:51:00 markus Exp $"); */ | 14/* RCSID("$OpenBSD: authfd.h,v 1.16 2000/12/20 19:37:21 markus Exp $"); */ |
15 16#ifndef AUTHFD_H 17#define AUTHFD_H 18 19#include "buffer.h" 20 21/* Messages for the authentication agent connection. */ 22#define SSH_AGENTC_REQUEST_RSA_IDENTITIES 1 --- 23 unchanged lines hidden (view full) --- 46 47typedef struct { 48 int fd; 49 Buffer identities; 50 int howmany; 51} AuthenticationConnection; 52 53/* Returns the number of the authentication fd, or -1 if there is none. */ | 15 16#ifndef AUTHFD_H 17#define AUTHFD_H 18 19#include "buffer.h" 20 21/* Messages for the authentication agent connection. */ 22#define SSH_AGENTC_REQUEST_RSA_IDENTITIES 1 --- 23 unchanged lines hidden (view full) --- 46 47typedef struct { 48 int fd; 49 Buffer identities; 50 int howmany; 51} AuthenticationConnection; 52 53/* Returns the number of the authentication fd, or -1 if there is none. */ |
54int ssh_get_authentication_socket(); | 54int ssh_get_authentication_socket(void); |
55 56/* 57 * This should be called for any descriptor returned by 58 * ssh_get_authentication_socket(). Depending on the way the descriptor was 59 * obtained, this may close the descriptor. 60 */ 61void ssh_close_authentication_socket(int authfd); 62 63/* 64 * Opens and connects a private socket for communication with the 65 * authentication agent. Returns NULL if an error occurred and the 66 * connection could not be opened. The connection should be closed by the 67 * caller by calling ssh_close_authentication_connection(). 68 */ | 55 56/* 57 * This should be called for any descriptor returned by 58 * ssh_get_authentication_socket(). Depending on the way the descriptor was 59 * obtained, this may close the descriptor. 60 */ 61void ssh_close_authentication_socket(int authfd); 62 63/* 64 * Opens and connects a private socket for communication with the 65 * authentication agent. Returns NULL if an error occurred and the 66 * connection could not be opened. The connection should be closed by the 67 * caller by calling ssh_close_authentication_connection(). 68 */ |
69AuthenticationConnection *ssh_get_authentication_connection(); | 69AuthenticationConnection *ssh_get_authentication_connection(void); |
70 71/* 72 * Closes the connection to the authentication agent and frees any associated 73 * memory. 74 */ 75void ssh_close_authentication_connection(AuthenticationConnection *auth); 76 77/* | 70 71/* 72 * Closes the connection to the authentication agent and frees any associated 73 * memory. 74 */ 75void ssh_close_authentication_connection(AuthenticationConnection *auth); 76 77/* |
78 * Returns the number authentication identity held by the agent. 79 */ 80int ssh_get_num_identities(AuthenticationConnection *auth, int version); 81 82/* |
|
78 * Returns the first authentication identity held by the agent or NULL if 79 * no identies are available. Caller must free comment and key. 80 * Note that you cannot mix calls with different versions. 81 */ 82Key *ssh_get_first_identity(AuthenticationConnection *auth, char **comment, int version); 83 84/* 85 * Returns the next authentication identity for the agent. Other functions --- 5 unchanged lines hidden (view full) --- 91 92/* 93 * Requests the agent to decrypt the given challenge. Returns true if the 94 * agent claims it was able to decrypt it. 95 */ 96int 97ssh_decrypt_challenge(AuthenticationConnection *auth, 98 Key *key, BIGNUM * challenge, | 83 * Returns the first authentication identity held by the agent or NULL if 84 * no identies are available. Caller must free comment and key. 85 * Note that you cannot mix calls with different versions. 86 */ 87Key *ssh_get_first_identity(AuthenticationConnection *auth, char **comment, int version); 88 89/* 90 * Returns the next authentication identity for the agent. Other functions --- 5 unchanged lines hidden (view full) --- 96 97/* 98 * Requests the agent to decrypt the given challenge. Returns true if the 99 * agent claims it was able to decrypt it. 100 */ 101int 102ssh_decrypt_challenge(AuthenticationConnection *auth, 103 Key *key, BIGNUM * challenge, |
99 unsigned char session_id[16], 100 unsigned int response_type, 101 unsigned char response[16]); | 104 u_char session_id[16], 105 u_int response_type, 106 u_char response[16]); |
102 103/* Requests the agent to sign data using key */ 104int 105ssh_agent_sign(AuthenticationConnection *auth, 106 Key *key, | 107 108/* Requests the agent to sign data using key */ 109int 110ssh_agent_sign(AuthenticationConnection *auth, 111 Key *key, |
107 unsigned char **sigp, int *lenp, 108 unsigned char *data, int datalen); | 112 u_char **sigp, int *lenp, 113 u_char *data, int datalen); |
109 110/* 111 * Adds an identity to the authentication server. This call is not meant to 112 * be used by normal applications. This returns true if the identity was 113 * successfully added. 114 */ 115int 116ssh_add_identity(AuthenticationConnection *auth, Key *key, --- 17 unchanged lines hidden --- | 114 115/* 116 * Adds an identity to the authentication server. This call is not meant to 117 * be used by normal applications. This returns true if the identity was 118 * successfully added. 119 */ 120int 121ssh_add_identity(AuthenticationConnection *auth, Key *key, --- 17 unchanged lines hidden --- |