Browse Subversion Repository
Contents of /trunk/ttssh2/ttxssh/hostkey.h
Parent Directory
| Revision Log
Revision 9255 -
( show annotations)
( download)
( as text)
Wed May 19 14:11:26 2021 UTC
(2 years, 9 months ago)
by nmaya
File MIME type: text/x-chdr
File size: 2569 byte(s)
SSH2 暗号化方式 chacha20-poly1305@openssh.com をサポート
merge from branches/ssh_chacha20poly1305
r9209, r9210, r9211, r9212, r9217, r9229, r9248, r9249, r9250, r9251, r9252, r9253
| 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 |
#define isFixedLengthKey(type) ((type) >= KEY_DSA && (type) <= KEY_ED25519) |
| 47 |
|
| 48 |
// fingerprint������ |
| 49 |
typedef enum { |
| 50 |
SSH_FP_DEFAULT = 0, |
| 51 |
SSH_FP_HEX, |
| 52 |
SSH_FP_BASE64, |
| 53 |
SSH_FP_BUBBLEBABBLE, |
| 54 |
SSH_FP_RANDOMART |
| 55 |
} fp_rep; |
| 56 |
|
| 57 |
/* |
| 58 |
enum fp_type { |
| 59 |
SSH_FP_MD5, |
| 60 |
SSH_FP_SHA1, |
| 61 |
SSH_FP_SHA256 |
| 62 |
}; |
| 63 |
*/ |
| 64 |
|
| 65 |
typedef enum { |
| 66 |
SSH_DIGEST_MD5, |
| 67 |
SSH_DIGEST_RIPEMD160, |
| 68 |
SSH_DIGEST_SHA1, |
| 69 |
SSH_DIGEST_SHA256, |
| 70 |
SSH_DIGEST_SHA384, |
| 71 |
SSH_DIGEST_SHA512, |
| 72 |
SSH_DIGEST_MAX, |
| 73 |
} digest_algorithm; |
| 74 |
|
| 75 |
|
| 76 |
ssh_keytype get_hostkey_type_from_name(char *name); |
| 77 |
char* get_ssh2_hostkey_type_name(ssh_keytype type); |
| 78 |
char *get_ssh2_hostkey_type_name_from_key(Key *key); |
| 79 |
char* get_digest_algorithm_name(digest_algorithm id); |
| 80 |
|
| 81 |
void normalize_host_key_order(char *buf); |
| 82 |
ssh_keytype choose_SSH2_host_key_algorithm(char *server_proposal, char *my_proposal); |
| 83 |
void SSH2_update_host_key_myproposal(PTInstVar pvar); |
| 84 |
|
| 85 |
#endif /* SSHCMAC_H */ |
| |