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 /* Authentication method type */
28 typedef unsigned short SilcAuthMethod;
30 /* Authentication methods in SILC protocol */
31 #define SILC_AUTH_NONE 0
32 #define SILC_AUTH_PASSWORD 1
33 #define SILC_AUTH_PUBLIC_KEY 2
35 /* Authentication protocol status message (used by all authentication
36 procols in the SILC). */
37 #define SILC_AUTH_OK 0
38 #define SILC_AUTH_FAILED 1
41 SilcAuthPayload silc_auth_payload_parse(SilcBuffer buffer);
42 SilcBuffer silc_auth_payload_encode(SilcAuthMethod method,
43 unsigned char *random_data,
44 unsigned short random_len,
45 unsigned char *auth_data,
46 unsigned short auth_len);
47 void silc_auth_payload_free(SilcAuthPayload payload);
48 SilcBuffer silc_auth_public_key_auth_generate(SilcPKCS pkcs,
50 void *id, SilcIdType type);
51 int silc_auth_public_key_auth_verify(SilcAuthPayload payload,
52 SilcPKCS pkcs, SilcHash hash,
53 void *id, SilcIdType type);
54 int silc_auth_public_key_auth_verify_data(SilcBuffer payload,
55 SilcPKCS pkcs, SilcHash hash,
56 void *id, SilcIdType type);