5 Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
7 Copyright (C) 2001 Pekka Riikonen
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
24 /* Forward declaration of the Authentication Payload */
25 typedef struct SilcAuthPayloadStruct *SilcAuthPayload;
27 /* Forward declaration of the Key Agreement Payload */
28 typedef struct SilcKeyAgreementPayloadStruct *SilcKeyAgreementPayload;
30 /* Authentication method type */
31 typedef unsigned short SilcAuthMethod;
33 /* Authentication methods in SILC protocol */
34 #define SILC_AUTH_NONE 0
35 #define SILC_AUTH_PASSWORD 1
36 #define SILC_AUTH_PUBLIC_KEY 2
38 /* Authentication protocol status message (used by all authentication
39 procols in the SILC). */
40 #define SILC_AUTH_OK 0
41 #define SILC_AUTH_FAILED 1
44 SilcAuthPayload silc_auth_payload_parse(SilcBuffer buffer);
45 SilcBuffer silc_auth_payload_encode(SilcAuthMethod method,
46 unsigned char *random_data,
47 unsigned short random_len,
48 unsigned char *auth_data,
49 unsigned short auth_len);
50 void silc_auth_payload_free(SilcAuthPayload payload);
51 SilcBuffer silc_auth_public_key_auth_generate(SilcPublicKey public_key,
53 void *id, SilcIdType type);
54 int silc_auth_public_key_auth_verify(SilcAuthPayload payload,
55 SilcPublicKey public_key, SilcHash hash,
56 void *id, SilcIdType type);
57 int silc_auth_public_key_auth_verify_data(SilcBuffer payload,
58 SilcPublicKey public_key,
60 void *id, SilcIdType type);
61 int silc_auth_verify(SilcAuthPayload payload, SilcAuthMethod auth_method,
62 void *auth_data, unsigned int auth_data_len,
63 SilcHash hash, void *id, SilcIdType type);
64 int silc_auth_verify_data(unsigned char *payload, unsigned int payload_len,
65 SilcAuthMethod auth_method, void *auth_data,
66 unsigned int auth_data_len, SilcHash hash,
67 void *id, SilcIdType type);
68 SilcKeyAgreementPayload silc_key_agreement_payload_parse(SilcBuffer buffer);
69 SilcBuffer silc_key_agreement_payload_encode(char *hostname,
71 void silc_key_agreement_payload_free(SilcKeyAgreementPayload payload);
72 char *silc_key_agreement_get_hostname(SilcKeyAgreementPayload payload);
73 unsigned int silc_key_agreement_get_port(SilcKeyAgreementPayload payload);