File: cramlib.h

package info (click to toggle)
courier-authlib 0.58-4%2Betch3
  • links: PTS
  • area: main
  • in suites: etch
  • size: 16,212 kB
  • ctags: 1,896
  • sloc: ansic: 21,550; sh: 14,071; makefile: 866; perl: 842; cpp: 284
file content (42 lines) | stat: -rw-r--r-- 1,040 bytes parent folder | download | duplicates (5)
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
35
36
37
38
39
40
41
42
#ifndef	cramlib_h
#define	cramlib_h

#include	"auth.h"

/*
** Copyright 1998 - 2004 Double Precision, Inc.  See COPYING for
** distribution information.
*/
struct cram_callback_info {
	struct hmac_hashinfo *h;
	char *user;
	char *challenge;
	char *response;
	int (*callback_func)(struct authinfo *, void *);
	void *callback_arg;
	};

extern int auth_cram_callback(struct authinfo *a, void *vp);
/*
** auth_get_cram parses out an authentication request.  It checks whether
** we have the requisite hash function installed, and, if so, base64decodes
** the challenge and the response.
*/

struct hmac_hashinfo;

int auth_get_cram(const char *authtype,			/* authtype */
		  char *authdata,			/* authdata */

		  struct cram_callback_info *craminfo);
		/* Initializes craminfo */
/*
** auth_verify_cram attempts to verify the secret cookie.
*/

int auth_verify_cram(struct hmac_hashinfo *,	/* The hash function */
	const char *,				/* The challenge */
	const char *,				/* The response */
	const char *);				/* Hashed secret, in hex */

#endif