Develop and Download Open Source Software

Browse Subversion Repository

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10068 - (show annotations) (download) (as text)
Sun Jul 17 15:39:53 2022 UTC (20 months, 3 weeks ago) by doda
File MIME type: text/x-chdr
File size: 3198 byte(s)
公開鍵認証で rsa-sha2-256/512 に対応した

Ticket: #36109

・優先度は rsa-sha2-512, rsa-sha2-256, ssh-rsa 固定
1 /*
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
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 KEY_ALGO_RSASHA256,
57 KEY_ALGO_RSASHA512,
58 KEY_ALGO_UNSPEC,
59 KEY_ALGO_MAX = KEY_ALGO_UNSPEC,
60 } ssh_keyalgo;
61 #define isFixedLengthKey(type) ((type) >= KEY_DSA && (type) <= KEY_ED25519)
62
63 // fingerprint������
64 typedef enum {
65 SSH_FP_DEFAULT = 0,
66 SSH_FP_HEX,
67 SSH_FP_BASE64,
68 SSH_FP_BUBBLEBABBLE,
69 SSH_FP_RANDOMART
70 } fp_rep;
71
72 /*
73 enum fp_type {
74 SSH_FP_MD5,
75 SSH_FP_SHA1,
76 SSH_FP_SHA256
77 };
78 */
79
80 typedef enum {
81 SSH_DIGEST_MD5,
82 SSH_DIGEST_RIPEMD160,
83 SSH_DIGEST_SHA1,
84 SSH_DIGEST_SHA256,
85 SSH_DIGEST_SHA384,
86 SSH_DIGEST_SHA512,
87 SSH_DIGEST_MAX,
88 } digest_algorithm;
89
90
91 ssh_keytype get_hostkey_type_from_name(char *name);
92 char* get_ssh2_hostkey_type_name(ssh_keytype type);
93 char *get_ssh2_hostkey_type_name_from_key(Key *key);
94 ssh_keyalgo get_ssh2_keyalgo_from_name(const char *name);
95 char* get_ssh2_keyalgo_name(ssh_keyalgo algo);
96 int get_ssh2_key_hashtype(ssh_keyalgo algo);
97 ssh_keytype get_ssh2_keytype_from_keyalgo(ssh_keyalgo algo);
98 const char* get_ssh2_keytype_name_from_keyalgo(ssh_keyalgo algo);
99 char* get_digest_algorithm_name(digest_algorithm id);
100
101 void normalize_host_key_order(char *buf);
102 ssh_keyalgo choose_SSH2_host_key_algorithm(char *server_proposal, char *my_proposal);
103 ssh_keyalgo choose_SSH2_keysign_algorithm(char *server_proposal, ssh_keytype keytype);
104 void SSH2_update_host_key_myproposal(PTInstVar pvar);
105
106 #endif /* SSHCMAC_H */

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