sasl.h 1.28 KB
Newer Older
Mati's avatar
Mati committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

#include <stdio.h>
#include <string.h>
#include "ntlm.h"
#include "hydra-mod.h"

#define AUTH_ERROR -1
#define AUTH_CLEAR 0
#define AUTH_APOP 1
#define AUTH_LOGIN 2
#define AUTH_PLAIN 3
#define AUTH_CRAMMD5 4
#define AUTH_CRAMSHA1 5
#define AUTH_CRAMSHA256 6
#define AUTH_DIGESTMD5 7
#define AUTH_SCRAMSHA1 8
#define AUTH_NTLM 9
#define AUTH_NTLMv2 10
#define AUTH_BASIC 11
#define AUTH_LM 12
#define AUTH_LMv2 13

#if LIBIDN
#include <stringprep.h>
#if defined HAVE_PR29_H
#include <pr29.h>
#endif
#endif

typedef enum {
  SASL_ALLOW_UNASSIGNED = 1
} sasl_saslprep_flags;


35
int32_t print_hex(unsigned char *buf, int32_t len);
Mati's avatar
Mati committed
36 37

void sasl_plain(char *result, char *login, char *pass);
38
int32_t sasl_saslprep(const char *in, sasl_saslprep_flags flags, char **out);
Mati's avatar
Mati committed
39

40
#ifdef LIBOPENSSL
Mati's avatar
Mati committed
41 42 43 44 45 46 47
#include <openssl/md5.h>
#include <openssl/sha.h>
#include <openssl/hmac.h>

void sasl_cram_md5(char *result, char *pass, char *challenge);
void sasl_cram_sha1(char *result, char *pass, char *challenge);
void sasl_cram_sha256(char *result, char *pass, char *challenge);
48
void sasl_digest_md5(char *result, char *login, char *pass, char *buffer, char *miscptr, char *type, char *webtarget, int32_t webport, char *header);
Mati's avatar
Mati committed
49 50
void sasl_scram_sha1(char *result, char *pass, char *clientfirstmessagebare, char *serverfirstmessage);
#endif