62 lines
2.5 KiB
C
62 lines
2.5 KiB
C
/****************************************************************************
|
|
* <Novell-copyright>
|
|
* Copyright (c) 2001 Novell, Inc. All Rights Reserved.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of version 2 of the GNU General Public License
|
|
* as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, contact Novell, Inc.
|
|
*
|
|
* To contact Novell about this file by physical or electronic mail, you
|
|
* may find current contact information at www.novell.com.
|
|
* </Novell-copyright>
|
|
****************************************************************************/
|
|
|
|
#ifndef BONGO_SASL_H
|
|
#define BONGO_SASL_H
|
|
|
|
#include <stddef.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct BongoSaslSession BongoSaslSession;
|
|
typedef int (*BongoSaslVerify)(void *context, const char *user,
|
|
const char *password, size_t password_length);
|
|
|
|
int BongoSaslInitialize(void);
|
|
void BongoSaslShutdown(void);
|
|
int BongoSaslSessionCreate(BongoSaslSession **session, const char *service,
|
|
const char *hostname, const char *local_address,
|
|
const char *remote_address, int tls_active,
|
|
BongoSaslVerify verify, void *context);
|
|
void BongoSaslSessionDestroy(BongoSaslSession **session);
|
|
int BongoSaslMechanisms(BongoSaslSession *session, const char **mechanisms);
|
|
int BongoSaslStart(BongoSaslSession *session, const char *mechanism,
|
|
const void *input, size_t input_length,
|
|
const void **output, size_t *output_length);
|
|
int BongoSaslStep(BongoSaslSession *session, const void *input,
|
|
size_t input_length, const void **output,
|
|
size_t *output_length);
|
|
const char *BongoSaslUsername(BongoSaslSession *session);
|
|
int BongoSaslDecode64(const char *input, size_t input_length, void *output,
|
|
size_t output_capacity, size_t *output_length);
|
|
int BongoSaslEncode64(const void *input, size_t input_length, char *output,
|
|
size_t output_capacity, size_t *output_length);
|
|
|
|
enum { BONGO_SASL_FAIL = -1, BONGO_SASL_COMPLETE = 0,
|
|
BONGO_SASL_CONTINUE = 1 };
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif
|