head	1.4;
access;
symbols
	netbsd-11-0-RC4:1.4
	netbsd-11-0-RC3:1.4
	netbsd-11-0-RC2:1.4
	netbsd-11-0-RC1:1.4
	perseant-exfatfs-base-20250801:1.4
	netbsd-11:1.4.0.60
	netbsd-11-base:1.4
	netbsd-10-1-RELEASE:1.4
	perseant-exfatfs-base-20240630:1.4
	perseant-exfatfs:1.4.0.58
	perseant-exfatfs-base:1.4
	netbsd-8-3-RELEASE:1.4
	netbsd-9-4-RELEASE:1.4
	netbsd-10-0-RELEASE:1.4
	netbsd-10-0-RC6:1.4
	netbsd-10-0-RC5:1.4
	netbsd-10-0-RC4:1.4
	netbsd-10-0-RC3:1.4
	netbsd-10-0-RC2:1.4
	netbsd-10-0-RC1:1.4
	netbsd-10:1.4.0.56
	netbsd-10-base:1.4
	netbsd-9-3-RELEASE:1.4
	cjep_sun2x-base1:1.4
	cjep_sun2x:1.4.0.54
	cjep_sun2x-base:1.4
	cjep_staticlib_x-base1:1.4
	netbsd-9-2-RELEASE:1.4
	cjep_staticlib_x:1.4.0.52
	cjep_staticlib_x-base:1.4
	netbsd-9-1-RELEASE:1.4
	phil-wifi-20200421:1.4
	phil-wifi-20200411:1.4
	is-mlppp:1.4.0.50
	is-mlppp-base:1.4
	phil-wifi-20200406:1.4
	netbsd-8-2-RELEASE:1.4
	netbsd-9-0-RELEASE:1.4
	netbsd-9-0-RC2:1.4
	netbsd-9-0-RC1:1.4
	phil-wifi-20191119:1.4
	netbsd-9:1.4.0.48
	netbsd-9-base:1.4
	phil-wifi-20190609:1.4
	netbsd-8-1-RELEASE:1.4
	netbsd-8-1-RC1:1.4
	pgoyette-compat-merge-20190127:1.4
	pgoyette-compat-20190127:1.4
	pgoyette-compat-20190118:1.4
	pgoyette-compat-1226:1.4
	pgoyette-compat-1126:1.4
	pgoyette-compat-1020:1.4
	pgoyette-compat-0930:1.4
	pgoyette-compat-0906:1.4
	netbsd-7-2-RELEASE:1.4
	pgoyette-compat-0728:1.4
	netbsd-8-0-RELEASE:1.4
	phil-wifi:1.4.0.46
	phil-wifi-base:1.4
	pgoyette-compat-0625:1.4
	netbsd-8-0-RC2:1.4
	pgoyette-compat-0521:1.4
	pgoyette-compat-0502:1.4
	pgoyette-compat-0422:1.4
	netbsd-8-0-RC1:1.4
	pgoyette-compat-0415:1.4
	pgoyette-compat-0407:1.4
	pgoyette-compat-0330:1.4
	pgoyette-compat-0322:1.4
	pgoyette-compat-0315:1.4
	netbsd-7-1-2-RELEASE:1.4
	pgoyette-compat:1.4.0.44
	pgoyette-compat-base:1.4
	netbsd-7-1-1-RELEASE:1.4
	matt-nb8-mediatek:1.4.0.42
	matt-nb8-mediatek-base:1.4
	perseant-stdc-iso10646:1.4.0.40
	perseant-stdc-iso10646-base:1.4
	netbsd-8:1.4.0.38
	netbsd-8-base:1.4
	prg-localcount2-base3:1.4
	prg-localcount2-base2:1.4
	prg-localcount2-base1:1.4
	prg-localcount2:1.4.0.36
	prg-localcount2-base:1.4
	pgoyette-localcount-20170426:1.4
	bouyer-socketcan-base1:1.4
	pgoyette-localcount-20170320:1.4
	netbsd-7-1:1.4.0.34
	netbsd-7-1-RELEASE:1.4
	netbsd-7-1-RC2:1.4
	netbsd-7-nhusb-base-20170116:1.4
	bouyer-socketcan:1.4.0.32
	bouyer-socketcan-base:1.4
	pgoyette-localcount-20170107:1.4
	netbsd-7-1-RC1:1.4
	pgoyette-localcount-20161104:1.4
	netbsd-7-0-2-RELEASE:1.4
	localcount-20160914:1.4
	netbsd-7-nhusb:1.4.0.30
	netbsd-7-nhusb-base:1.4
	pgoyette-localcount-20160806:1.4
	pgoyette-localcount-20160726:1.4
	pgoyette-localcount:1.4.0.28
	pgoyette-localcount-base:1.4
	netbsd-7-0-1-RELEASE:1.4
	netbsd-7-0:1.4.0.26
	netbsd-7-0-RELEASE:1.4
	netbsd-7-0-RC3:1.4
	netbsd-7-0-RC2:1.4
	netbsd-7-0-RC1:1.4
	netbsd-6-0-6-RELEASE:1.4
	netbsd-6-1-5-RELEASE:1.4
	netbsd-7:1.4.0.24
	netbsd-7-base:1.4
	yamt-pagecache-base9:1.4
	yamt-pagecache-tag8:1.4
	netbsd-6-1-4-RELEASE:1.4
	netbsd-6-0-5-RELEASE:1.4
	tls-earlyentropy:1.4.0.22
	tls-earlyentropy-base:1.4
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.4
	riastradh-drm2-base3:1.4
	netbsd-6-1-3-RELEASE:1.4
	netbsd-6-0-4-RELEASE:1.4
	netbsd-6-1-2-RELEASE:1.4
	netbsd-6-0-3-RELEASE:1.4
	netbsd-6-1-1-RELEASE:1.4
	riastradh-drm2-base2:1.4
	riastradh-drm2-base1:1.4
	riastradh-drm2:1.4.0.14
	riastradh-drm2-base:1.4
	netbsd-6-1:1.4.0.20
	netbsd-6-0-2-RELEASE:1.4
	netbsd-6-1-RELEASE:1.4
	khorben-n900:1.4.0.18
	netbsd-6-1-RC4:1.4
	netbsd-6-1-RC3:1.4
	agc-symver:1.4.0.16
	agc-symver-base:1.4
	netbsd-6-1-RC2:1.4
	netbsd-6-1-RC1:1.4
	yamt-pagecache-base8:1.4
	netbsd-6-0-1-RELEASE:1.4
	yamt-pagecache-base7:1.4
	matt-nb6-plus-nbase:1.4
	yamt-pagecache-base6:1.4
	netbsd-6-0:1.4.0.12
	netbsd-6-0-RELEASE:1.4
	netbsd-6-0-RC2:1.4
	tls-maxphys:1.4.0.10
	tls-maxphys-base:1.4
	matt-nb6-plus:1.4.0.8
	matt-nb6-plus-base:1.4
	netbsd-6-0-RC1:1.4
	yamt-pagecache-base5:1.4
	yamt-pagecache-base4:1.4
	netbsd-6:1.4.0.6
	netbsd-6-base:1.4
	yamt-pagecache-base3:1.4
	yamt-pagecache-base2:1.4
	yamt-pagecache:1.4.0.4
	yamt-pagecache-base:1.4
	cherry-xenmp:1.4.0.2
	cherry-xenmp-base:1.4
	bouyer-quota2-nbase:1.4
	bouyer-quota2:1.1.1.1.0.2
	bouyer-quota2-base:1.4
	matt-mips64-premerge-20101231:1.1.1.1
	sasl-client-lib-base:1.1.1.1
	KOCIELS:1.1.1;
locks; strict;
comment	@# @;


1.4
date	2011.02.12.23.21.33;	author christos;	state Exp;
branches;
next	1.3;

1.3
date	2011.02.11.23.44.43;	author christos;	state Exp;
branches;
next	1.2;

1.2
date	2011.01.29.23.35.31;	author agc;	state Exp;
branches;
next	1.1;

1.1
date	2010.11.27.21.23.59;	author agc;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2010.11.27.21.23.59;	author agc;	state Exp;
branches
	1.1.1.1.2.1;
next	;

1.1.1.1.2.1
date	2011.02.08.16.18.31;	author bouyer;	state Exp;
branches;
next	1.1.1.1.2.2;

1.1.1.1.2.2
date	2011.02.17.11.57.13;	author bouyer;	state Exp;
branches;
next	;


desc
@@


1.4
log
@Fix botched merges of the patch that Anon Ymous sent. From Anon Ymous
@
text
@# $NetBSD: Makefile,v 1.3 2011/02/11 23:44:43 christos Exp $

CC=gcc
SRC_PREFIX=../src
CFLAGS=-I../include -I$(SRC_PREFIX) -D SASLC_TEST_DIR=\"`pwd`/\"
ATFLIBS=-latf-c -lssl
LDFLAGS=`pwd`/$(SRC_PREFIX)/libsaslc.so -ggdb
TEST_CASES_C=t_dict t_session t_crypto t_error t_saslc t_parser
TEST_CASES=$(TEST_CASES_C)
VALGRIND=valgrind
VALGRIND_OPTS=--leak-check=full -q

all: build

build: $(TEST_CASES_SH) $(TEST_CASES_C) example_client

$(TEST_CASES_SH):
	@@echo "building $@@"
	@@$(ENV) atf-compile -o $@@ $@@.sh

$(TEST_CASES_C):
	@@echo "building $@@"
	@@$(CC) -o $@@.o -c $@@.c $(CFLAGS) -I/usr/include/local
	@@$(CC) -o $@@ $@@.o $(LDFLAGS) $(ATFLIBS)

atf:
	@@echo ""
	@@echo "*************************************"
	@@echo "* ATF TESTS:                        *"
	@@echo "*************************************"
	@@echo ""
	@@$(ENV) atf-run -v test_dir=`pwd` | $(ENV) atf-report

valgrind:
	@@echo ""
	@@echo "*************************************"
	@@echo "* VALGRIND TESTS:                   *"
	@@echo "*************************************"
	@@echo ""
	@@for prog in $(TEST_CASES); do \
		echo "$$prog:"; \
		for testcase in `./$$prog -l | grep ident | awk {'print $$2'}`; do \
			echo " * $$testcase"; \
			$(VALGRIND) $(VALGRIND_OPTS) ./$$prog $$testcase ; \
		done \
	done

tests: build atf valgrind

example_client: example_client.c

clean:
	@@rm -f $(TEST_CASES_C) $(TEST_CASES_SH) *.o resfile \
	    example_client
@


1.3
log
@Changes from Anon Ymous:

Make this library work.
- several API changes (see the manpage)
- take care to match the spec (hopefully)
- deal with comma delimited lists more systematically
- addition of the DIGEST-MD5 security layer
- syslog messages including debugging messages
- many coding simplifications, changes, rewrites, and additions (i.e.,
  stuff I can't recall at the moment)
- rewrite the manpage

The API changes have been heavily influenced by hooking this up to
postfix(1).

The ANONYMOUS, LOGIN, PLAIN, CRAM-MD5, DIGEST-MD5, and GSSAPI
authentication mechanisms have been tested and shown to work for
authentication with a postfix(1) server using the cyrus-sasl library.
(A postfix(1) libsaslc(3) client wrapper was used for the testing and
will be committed separately.)

The EXTERNAL authentication mechanism should work (it is pretty
simple), but it has not been tested with any servers.

The security layers of DIGEST-MD5 and GSSAPI have also not been tested
with any servers.  Do any SMTP servers really support these security
layers?  Postfix with cyrus-sasl does not, either as a client or
server, even though the cyrus-sasl library has support for the layers.

The new DIGEST-MD5 security layer encode/decode routines have been
tested against themselves (not terribly useful), but nothing else.  As
they use the openssl EVP_* routines (which aren't well documented) to
do the cryptography, the "auth-conf" layer may or may not actually
match the rfc2831 standard.  The "auth-int" layer is much more likely
to be in compliance.

Note: I have left support for a version of AES in the DIGEST-MD5 code
even though it is not part of rfc2831 (May 2000).  This flavor of AES
was in a later draft (June 2003) that was included in the cyrus-sasl
distribution, but changed to a different flavor of AES in subsequent
drafts (and DES disappeared).  AFAIKT, none of those drafts have been
accepted; the last I could find expired in Sept 2007.  rfc2831 is
still listed as standards track.  The AES support is very minor (some
table entries and a few lines of code to construct the IV) and I was
asked to leave it for now.

Hopefully there are not too many bugs, memory leaks, or
spelling/grammar errors.  My apologies in advance.

BTW, if you would prefer to use cyrus-sasl, install it (e.g., from
pkgsrc), and then rebuild postfix with HAVE_CYRUS_SASL defined.
@
text
@d1 1
a1 1
# $NetBSD:$
a8 1
TEST_CASES_SH=t_mech
@


1.2
log
@sync sources with sourceforge repository, prompted by Mateusz Kocielski.

+ minor changes to free resources in error cases
+ update return values from some functions
+ wrap some long lines
+ more tests
+ add length argument to digest functions

an additional minor fix to make this build, and to libsaslc.3 man
page, by myself.
@
text
@d1 1
a1 1
# $Id: Makefile,v 1.12 2011/01/24 19:56:33 mkocielski Exp $
d5 1
a5 2
CFLAGS=-I../include -I$(SRC_PREFIX)
ENV=PATH=/usr/local/bin:${PATH}
d19 2
a20 2
		@@echo "building $@@"
		@@$(ENV) atf-compile -o $@@ $@@.sh
d23 3
a25 3
		@@echo "building $@@"
		@@$(CC) -o $@@.o -c $@@.c $(CFLAGS) -I/usr/include/local
		@@$(CC) -o $@@ $@@.o $(LDFLAGS) $(ATFLIBS)
d28 6
a33 6
		@@echo ""
		@@echo "*************************************"
		@@echo "* ATF TESTS:                        *"
		@@echo "*************************************"
		@@echo ""
		@@$(ENV) atf-run -v test_dir=`pwd` | $(ENV) atf-report
d36 12
a47 12
		@@echo ""
		@@echo "*************************************"
		@@echo "* VALGRIND TESTS:                   *"
		@@echo "*************************************"
		@@echo ""
		@@for prog in $(TEST_CASES); do \
			echo "$$prog:"; \
			for testcase in `./$$prog -l | grep ident | awk {'print $$2'}`; do \
				echo " * $$testcase"; \
				$(VALGRIND) $(VALGRIND_OPTS) ./$$prog $$testcase ; \
			done \
		done
d54 2
a55 2
		@@rm -f $(TEST_CASES_C) $(TEST_CASES_SH) *.o resfile \
		    example_client
@


1.1
log
@Initial revision
@
text
@d1 1
a1 1
# $Id: Makefile,v 1.1.1.1 2010/10/23 13:53:44 agc Exp $
d9 3
a11 1
TEST_CASES=t_dict t_session t_crypto t_error t_saslc t_parser
d17 1
a17 1
build: $(TEST_CASES) example_client
d19 8
a26 3
$(TEST_CASES):
		$(CC) -o $@@.o -c $@@.c $(CFLAGS) -I/usr/include/local
		$(CC) -o $@@ $@@.o $(LDFLAGS) $(ATFLIBS)
d29 6
a34 2
		@@echo "atf tests:"
		@@$(ENV) atf-run | $(ENV) atf-report
d37 5
a41 1
		@@echo "valgrind tests:"
d55 2
a56 1
		rm -f $(TEST_CASES) *.o resfile example_client
@


1.1.1.1
log
@Initial import of Mateusz Kociels SASL client library Summer of Code
project into the repository. The project was mentored by Christos
Zoulas, and written up here:

	http://netbsd-soc.sourceforge.net/projects/sasl_client_lib/

As discussed with Christos Zoulas.
@
text
@@


1.1.1.1.2.1
log
@Sync with HEAD
@
text
@d1 1
a1 1
# $Id: Makefile,v 1.2 2011/01/29 23:35:31 agc Exp $
d9 1
a9 3
TEST_CASES_C=t_dict t_session t_crypto t_error t_saslc t_parser
TEST_CASES_SH=t_mech
TEST_CASES=$(TEST_CASES_C)
d15 1
a15 1
build: $(TEST_CASES_SH) $(TEST_CASES_C) example_client
d17 3
a19 8
$(TEST_CASES_SH):
		@@echo "building $@@"
		@@$(ENV) atf-compile -o $@@ $@@.sh

$(TEST_CASES_C):
		@@echo "building $@@"
		@@$(CC) -o $@@.o -c $@@.c $(CFLAGS) -I/usr/include/local
		@@$(CC) -o $@@ $@@.o $(LDFLAGS) $(ATFLIBS)
d22 2
a23 6
		@@echo ""
		@@echo "*************************************"
		@@echo "* ATF TESTS:                        *"
		@@echo "*************************************"
		@@echo ""
		@@$(ENV) atf-run -v test_dir=`pwd` | $(ENV) atf-report
d26 1
a26 5
		@@echo ""
		@@echo "*************************************"
		@@echo "* VALGRIND TESTS:                   *"
		@@echo "*************************************"
		@@echo ""
d40 1
a40 2
		@@rm -f $(TEST_CASES_C) $(TEST_CASES_SH) *.o resfile \
		    example_client
@


1.1.1.1.2.2
log
@Sync with HEAD
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.4 2011/02/12 23:21:33 christos Exp $
d5 2
a6 1
CFLAGS=-I../include -I$(SRC_PREFIX) -D SASLC_TEST_DIR=\"`pwd`/\"
d10 1
d20 2
a21 2
	@@echo "building $@@"
	@@$(ENV) atf-compile -o $@@ $@@.sh
d24 3
a26 3
	@@echo "building $@@"
	@@$(CC) -o $@@.o -c $@@.c $(CFLAGS) -I/usr/include/local
	@@$(CC) -o $@@ $@@.o $(LDFLAGS) $(ATFLIBS)
d29 6
a34 6
	@@echo ""
	@@echo "*************************************"
	@@echo "* ATF TESTS:                        *"
	@@echo "*************************************"
	@@echo ""
	@@$(ENV) atf-run -v test_dir=`pwd` | $(ENV) atf-report
d37 12
a48 12
	@@echo ""
	@@echo "*************************************"
	@@echo "* VALGRIND TESTS:                   *"
	@@echo "*************************************"
	@@echo ""
	@@for prog in $(TEST_CASES); do \
		echo "$$prog:"; \
		for testcase in `./$$prog -l | grep ident | awk {'print $$2'}`; do \
			echo " * $$testcase"; \
			$(VALGRIND) $(VALGRIND_OPTS) ./$$prog $$testcase ; \
		done \
	done
d55 2
a56 2
	@@rm -f $(TEST_CASES_C) $(TEST_CASES_SH) *.o resfile \
	    example_client
@


