Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /trunk/ttssh2/ttxssh/hostkey.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10070 - (hide annotations) (download) (as text)
Sun Jul 17 15:40:17 2022 UTC (20 months, 3 weeks ago) by doda
File MIME type: text/x-chdr
File size: 3395 byte(s)
pageant認証をrsa-sha2-256/512に対応させた
1 nmaya 9210 /*
2     * (C) 2021- TeraTerm Project
3     * All rights reserved.
4     *
5     * Redistribution and use in source and binary forms, with or without
6     * modification, are permitted provided that the following conditions
7     * are met:
8     *
9     * 1. Redistributions of source code must retain the above copyright
10     * notice, this list of conditions and the following disclaimer.
11     * 2. Redistributions in binary form must reproduce the above copyright
12     * notice, this list of conditions and the following disclaimer in the
13     * documentation and/or other materials provided with the distribution.
14     * 3. The name of the author may not be used to endorse or promote products
15     * derived from this software without specific prior written permission.
16     *
17     * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
18     * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19     * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20     * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21     * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22     * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23     * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24     * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26     * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27     */
28    
29     #ifndef HOSTKEY_H
30     #define HOSTKEY_H
31    
32     typedef struct Key Key;
33    
34     typedef enum {
35     KEY_NONE,
36     KEY_RSA1,
37     KEY_RSA,
38     KEY_DSA,
39     KEY_ECDSA256,
40     KEY_ECDSA384,
41     KEY_ECDSA521,
42     KEY_ED25519,
43     KEY_UNSPEC,
44     KEY_MAX = KEY_UNSPEC,
45     } ssh_keytype;
46 doda 10064
47     typedef enum {
48     KEY_ALGO_NONE,
49     KEY_ALGO_RSA1,
50     KEY_ALGO_RSA,
51     KEY_ALGO_DSA,
52     KEY_ALGO_ECDSA256,
53     KEY_ALGO_ECDSA384,
54     KEY_ALGO_ECDSA521,
55     KEY_ALGO_ED25519,
56 doda 10065 KEY_ALGO_RSASHA256,
57     KEY_ALGO_RSASHA512,
58 doda 10064 KEY_ALGO_UNSPEC,
59     KEY_ALGO_MAX = KEY_ALGO_UNSPEC,
60     } ssh_keyalgo;
61 doda 10070
62     typedef enum {
63     SSH_AGENT_SIGN_DEFAULT = 0,
64     SSH_AGENT_RSA_SHA2_256 = 2,
65     SSH_AGENT_RSA_SHA2_512 = 4,
66     } ssh_agentflag;
67 nmaya 9210 #define isFixedLengthKey(type) ((type) >= KEY_DSA && (type) <= KEY_ED25519)
68    
69     // fingerprint������
70     typedef enum {
71     SSH_FP_DEFAULT = 0,
72     SSH_FP_HEX,
73     SSH_FP_BASE64,
74     SSH_FP_BUBBLEBABBLE,
75     SSH_FP_RANDOMART
76     } fp_rep;
77    
78     /*
79     enum fp_type {
80     SSH_FP_MD5,
81     SSH_FP_SHA1,
82     SSH_FP_SHA256
83     };
84     */
85    
86     typedef enum {
87     SSH_DIGEST_MD5,
88     SSH_DIGEST_RIPEMD160,
89     SSH_DIGEST_SHA1,
90     SSH_DIGEST_SHA256,
91     SSH_DIGEST_SHA384,
92     SSH_DIGEST_SHA512,
93     SSH_DIGEST_MAX,
94     } digest_algorithm;
95    
96    
97     ssh_keytype get_hostkey_type_from_name(char *name);
98     char* get_ssh2_hostkey_type_name(ssh_keytype type);
99     char *get_ssh2_hostkey_type_name_from_key(Key *key);
100 doda 10069 ssh_keyalgo get_ssh2_hostkey_algorithm_from_name(const char *name);
101     char* get_ssh2_hostkey_algorithm_name(ssh_keyalgo algo);
102 doda 10065 int get_ssh2_key_hashtype(ssh_keyalgo algo);
103 doda 10070 int get_ssh2_agent_flag(ssh_keyalgo algo);
104 doda 10069 ssh_keytype get_ssh2_hostkey_type_from_algorithm(ssh_keyalgo algo);
105     const char* get_ssh2_hostkey_type_name_from_algorithm(ssh_keyalgo algo);
106 nmaya 9210 char* get_digest_algorithm_name(digest_algorithm id);
107    
108     void normalize_host_key_order(char *buf);
109 doda 10064 ssh_keyalgo choose_SSH2_host_key_algorithm(char *server_proposal, char *my_proposal);
110 doda 10068 ssh_keyalgo choose_SSH2_keysign_algorithm(char *server_proposal, ssh_keytype keytype);
111 nmaya 9210 void SSH2_update_host_key_myproposal(PTInstVar pvar);
112    
113     #endif /* SSHCMAC_H */

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26