Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2001 - 2003 Pekka Riikonen
+ Copyright (C) 2001 - 2007 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#define SILC_AUTH_PASSWORD 1 /* Passphrase authentication */
#define SILC_AUTH_PUBLIC_KEY 2 /* Public key authentication */
-/* Authentication protocol status message (used by all authentication
- protocols in the SILC). */
-#define SILC_AUTH_OK 0
-#define SILC_AUTH_FAILED 1
+/****d* silccore/SilcAuthAPI/SilcAuthResult
+ *
+ * NAME
+ *
+ * typedef SilcUInt32 SilcAuthResult;
+ *
+ * DESCRIPTION
+ *
+ * Authentication protocol status. Used by all authentication protocols
+ * in SILC.
+ *
+ * SOURCE
+ */
+typedef SilcUInt32 SilcAuthResult;
+
+#define SILC_AUTH_OK 0 /* Authentication successful */
+#define SILC_AUTH_FAILED 1 /* Authentication failed */
/***/
/****s* silccore/SilcAuthAPI/SilcAuthPayload
*
***/
SilcBool silc_auth_public_key_auth_verify(SilcAuthPayload payload,
- SilcPublicKey public_key, SilcHash hash,
- const void *id, SilcIdType type);
+ SilcPublicKey public_key,
+ SilcHash hash,
+ const void *id,
+ SilcIdType type);
/****f* silccore/SilcAuthAPI/silc_auth_public_key_auth_verify_data
*
*
***/
SilcBool silc_auth_public_key_auth_verify_data(const unsigned char *payload,
- SilcUInt32 payload_len,
- SilcPublicKey public_key,
- SilcHash hash,
- const void *id, SilcIdType type);
+ SilcUInt32 payload_len,
+ SilcPublicKey public_key,
+ SilcHash hash,
+ const void *id,
+ SilcIdType type);
/****f* silccore/SilcAuthAPI/silc_auth_verify
*
*
***/
SilcBool silc_auth_verify(SilcAuthPayload payload, SilcAuthMethod auth_method,
- const void *auth_data, SilcUInt32 auth_data_len,
- SilcHash hash, const void *id, SilcIdType type);
+ const void *auth_data, SilcUInt32 auth_data_len,
+ SilcHash hash, const void *id, SilcIdType type);
/****f* silccore/SilcAuthAPI/silc_auth_verify_data
*
*
***/
SilcBool silc_auth_verify_data(const unsigned char *payload,
- SilcUInt32 payload_len,
- SilcAuthMethod auth_method, const void *auth_data,
- SilcUInt32 auth_data_len, SilcHash hash,
- const void *id, SilcIdType type);
+ SilcUInt32 payload_len,
+ SilcAuthMethod auth_method,
+ const void *auth_data,
+ SilcUInt32 auth_data_len, SilcHash hash,
+ const void *id, SilcIdType type);
/****s* silccore/SilcAuthAPI/SilcKeyAgreementPayload
*
* SYNOPSIS
*
* SilcBuffer silc_key_agreement_payload_encode(char *hostname,
- * SilcUInt32 port);
+ * SilcUInt16 protocol,
+ * SilcUInt16 port);
*
* DESCRIPTION
*
- * Encodes the Key Agreement protocol and returns the encoded buffer
+ * Encodes the Key Agreement payload and returns the encoded buffer.
+ * The `protocol' is 0 for TCP and 1 for UDP.
*
***/
SilcBuffer silc_key_agreement_payload_encode(const char *hostname,
- SilcUInt32 port);
+ SilcUInt16 protocol,
+ SilcUInt16 port);
/****f* silccore/SilcAuthAPI/silc_key_agreement_payload_free
*
*
* DESCRIPTION
*
- * Frees the Key Agreement protocol and all data in it.
+ * Frees the Key Agreement payload and all data in it.
*
***/
void silc_key_agreement_payload_free(SilcKeyAgreementPayload payload);
***/
char *silc_key_agreement_get_hostname(SilcKeyAgreementPayload payload);
+/****f* silccore/SilcAuthAPI/silc_key_agreement_get_protocol
+ *
+ * SYNOPSIS
+ *
+ * SilcUInt16
+ * silc_key_agreement_get_protocol(SilcKeyAgreementPayload payload);
+ *
+ * DESCRIPTION
+ *
+ * Returns the protocol in the payload. The protocol is either TCP (0)
+ * or UDP (1).
+ *
+ ***/
+SilcUInt16 silc_key_agreement_get_protocol(SilcKeyAgreementPayload payload);
+
/****f* silccore/SilcAuthAPI/silc_key_agreement_get_port
*
* SYNOPSIS
*
- * SilcUInt32 silc_key_agreement_get_port(SilcKeyAgreementPayload payload);
+ * SilcUInt16 silc_key_agreement_get_port(SilcKeyAgreementPayload payload);
*
* DESCRIPTION
*
* the SILC Key Exchange protocol.
*
***/
-SilcUInt32 silc_key_agreement_get_port(SilcKeyAgreementPayload payload);
+SilcUInt16 silc_key_agreement_get_port(SilcKeyAgreementPayload payload);
#endif