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 10064 - (show annotations) (download) (as text)
Sun Jul 17 15:39:09 2022 UTC (20 months, 3 weeks ago) by doda
File MIME type: text/x-chdr
File size: 3073 byte(s)
公開鍵形式と公開鍵署名アルゴリズムを分離した

rsa-sha2-256/512(署名形式)では公開鍵形式としてssh-rsaを使うため。
pvar->hostkey_type は署名アルゴリズムが格納されるようになる。
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_UNSPEC,
57 KEY_ALGO_MAX = KEY_ALGO_UNSPEC,
58 } ssh_keyalgo;
59 #define isFixedLengthKey(type) ((type) >= KEY_DSA && (type) <= KEY_ED25519)
60
61 // fingerprint������
62 typedef enum {
63 SSH_FP_DEFAULT = 0,
64 SSH_FP_HEX,
65 SSH_FP_BASE64,
66 SSH_FP_BUBBLEBABBLE,
67 SSH_FP_RANDOMART
68 } fp_rep;
69
70 /*
71 enum fp_type {
72 SSH_FP_MD5,
73 SSH_FP_SHA1,
74 SSH_FP_SHA256
75 };
76 */
77
78 typedef enum {
79 SSH_DIGEST_MD5,
80 SSH_DIGEST_RIPEMD160,
81 SSH_DIGEST_SHA1,
82 SSH_DIGEST_SHA256,
83 SSH_DIGEST_SHA384,
84 SSH_DIGEST_SHA512,
85 SSH_DIGEST_MAX,
86 } digest_algorithm;
87
88
89 ssh_keytype get_hostkey_type_from_name(char *name);
90 char* get_ssh2_hostkey_type_name(ssh_keytype type);
91 char *get_ssh2_hostkey_type_name_from_key(Key *key);
92 ssh_keyalgo get_ssh2_keyalgo_from_name(const char *name);
93 char* get_ssh2_keyalgo_name(ssh_keyalgo algo);
94 int get_ssh2_keyalgo_hashtype(ssh_keyalgo algo);
95 ssh_keytype get_ssh2_keytype_from_keyalgo(ssh_keyalgo algo);
96 const char* get_ssh2_keytype_name_from_keyalgo(ssh_keyalgo algo);
97 char* get_digest_algorithm_name(digest_algorithm id);
98
99 void normalize_host_key_order(char *buf);
100 ssh_keyalgo choose_SSH2_host_key_algorithm(char *server_proposal, char *my_proposal);
101 void SSH2_update_host_key_myproposal(PTInstVar pvar);
102
103 #endif /* SSHCMAC_H */

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