Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/libsaslc/dist sync sources with sourcefo...



details:   https://anonhg.NetBSD.org/src/rev/61d4585986d3
branches:  trunk
changeset: 761494:61d4585986d3
user:      agc <agc%NetBSD.org@localhost>
date:      Sat Jan 29 23:35:30 2011 +0000

description:
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.

diffstat:

 crypto/external/bsd/libsaslc/dist/doc/library.txt       |    2 +-
 crypto/external/bsd/libsaslc/dist/include/saslc.h       |    7 +-
 crypto/external/bsd/libsaslc/dist/index.html            |   30 +--
 crypto/external/bsd/libsaslc/dist/man/libsaslc.3        |   74 ++++---
 crypto/external/bsd/libsaslc/dist/soc.html              |    2 +-
 crypto/external/bsd/libsaslc/dist/src/Makefile          |    9 +-
 crypto/external/bsd/libsaslc/dist/src/Makefile.bsd      |   25 +-
 crypto/external/bsd/libsaslc/dist/src/crypto.c          |   68 +++---
 crypto/external/bsd/libsaslc/dist/src/crypto.h          |    7 +-
 crypto/external/bsd/libsaslc/dist/src/dict.c            |   56 +++--
 crypto/external/bsd/libsaslc/dist/src/dict.h            |   13 +-
 crypto/external/bsd/libsaslc/dist/src/error.c           |    6 +-
 crypto/external/bsd/libsaslc/dist/src/error.h           |   10 +-
 crypto/external/bsd/libsaslc/dist/src/mech.c            |  139 +++++++++++---
 crypto/external/bsd/libsaslc/dist/src/mech.h            |   60 ++---
 crypto/external/bsd/libsaslc/dist/src/mech_anonymous.c  |    7 +-
 crypto/external/bsd/libsaslc/dist/src/mech_crammd5.c    |   65 +++---
 crypto/external/bsd/libsaslc/dist/src/mech_digestmd5.c  |   25 +-
 crypto/external/bsd/libsaslc/dist/src/mech_external.c   |    7 +-
 crypto/external/bsd/libsaslc/dist/src/mech_gssapi.c     |   23 +-
 crypto/external/bsd/libsaslc/dist/src/mech_login.c      |    7 +-
 crypto/external/bsd/libsaslc/dist/src/mech_plain.c      |   13 +-
 crypto/external/bsd/libsaslc/dist/src/parser.c          |   16 +-
 crypto/external/bsd/libsaslc/dist/src/parser.h          |    4 +-
 crypto/external/bsd/libsaslc/dist/src/saslc.c           |  154 ++++++++-------
 crypto/external/bsd/libsaslc/dist/src/saslc_private.h   |   28 +-
 crypto/external/bsd/libsaslc/dist/src/xsess.c           |   90 +++++----
 crypto/external/bsd/libsaslc/dist/style.css             |    2 +-
 crypto/external/bsd/libsaslc/dist/test/Atffile          |    1 +
 crypto/external/bsd/libsaslc/dist/test/Makefile         |   36 ++-
 crypto/external/bsd/libsaslc/dist/test/example_client.c |   15 +-
 crypto/external/bsd/libsaslc/dist/test/t_crypto.c       |    6 +-
 crypto/external/bsd/libsaslc/dist/test/t_dict.c         |    2 +-
 crypto/external/bsd/libsaslc/dist/test/t_error.c        |    9 +-
 crypto/external/bsd/libsaslc/dist/test/t_parser.c       |   43 +++-
 crypto/external/bsd/libsaslc/dist/test/t_saslc.c        |    4 +-
 crypto/external/bsd/libsaslc/dist/test/t_session.c      |   15 +-
 37 files changed, 606 insertions(+), 474 deletions(-)

diffs (truncated from 2336 to 300 lines):

diff -r 47bd94e51bdf -r 61d4585986d3 crypto/external/bsd/libsaslc/dist/doc/library.txt
--- a/crypto/external/bsd/libsaslc/dist/doc/library.txt Sat Jan 29 23:19:54 2011 +0000
+++ b/crypto/external/bsd/libsaslc/dist/doc/library.txt Sat Jan 29 23:35:30 2011 +0000
@@ -1,7 +1,7 @@
 SASL client library - draft
 ---------------------------
 
-Version: $Id: library.txt,v 1.1.1.1 2010/11/27 21:23:58 agc Exp $
+Version: $Id: library.txt,v 1.2 2011/01/29 23:35:30 agc Exp $
 
 1. Typedefs
 
diff -r 47bd94e51bdf -r 61d4585986d3 crypto/external/bsd/libsaslc/dist/include/saslc.h
--- a/crypto/external/bsd/libsaslc/dist/include/saslc.h Sat Jan 29 23:19:54 2011 +0000
+++ b/crypto/external/bsd/libsaslc/dist/include/saslc.h Sat Jan 29 23:35:30 2011 +0000
@@ -1,4 +1,4 @@
-/* $Id: saslc.h,v 1.1.1.1 2010/11/27 21:23:58 agc Exp $ */
+/* $Id: saslc.h,v 1.2 2011/01/29 23:35:30 agc Exp $ */
 
 /* Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -38,6 +38,7 @@
 #ifndef _SASLC_H_
 #define _SASLC_H_
 
+#include <stdbool.h>
 #include <stdlib.h>
 
 typedef struct saslc_t saslc_t;
@@ -46,7 +47,7 @@
 /* begin and end */
 saslc_t *saslc_alloc(void);
 int saslc_init(saslc_t *, const char *);
-int saslc_end(saslc_t *);
+int saslc_end(saslc_t *, bool);
 
 /* error */
 const char *saslc_strerror(saslc_t *);
@@ -68,4 +69,4 @@
 int saslc_sess_decode(saslc_sess_t *, const void *, size_t, void **,
     size_t *);
 
-#endif /* !_SASLC_H_ */
+#endif /* ! _SASLC_H_ */
diff -r 47bd94e51bdf -r 61d4585986d3 crypto/external/bsd/libsaslc/dist/index.html
--- a/crypto/external/bsd/libsaslc/dist/index.html      Sat Jan 29 23:19:54 2011 +0000
+++ b/crypto/external/bsd/libsaslc/dist/index.html      Sat Jan 29 23:35:30 2011 +0000
@@ -46,33 +46,7 @@
                <a name="status"></a>
                <p class="header">Status</p>
 
-               <b>Project schedule:</b>
-               <ul>
-                       <li> <b>August 23 - September 3:</b>
-                       <ul>
-                                       <li>postfix integration</li>
-                                       <li>testing/fixing</li>
-                       </ul>
-                       </li>
-               </ul>
-               <ul>
-                       <li> <b>September 4 - September 8:</b>
-                       <ul>
-                                       <li>improving DIGEST-MD5 implementation</li>
-                                       <li>improving test infrastructure</li>
-                       </ul>
-                       </li>
-               </ul>
-               <ul>
-                       <li> <b>September 8 - September 12:</b>
-                       <ul>
-                                       <li>improving code quality</li>
-                                       <li>improving documentation</li>
-                       </ul>
-                       </li>
-               </ul>
-
-               Future plans involves implementing others mechanisms (i.e. S/KEY).
+               I'm working now on improving existing code and integration with the Postfix. I hope to be ready with it soon. My future plans involves implementing others mechanisms (i.e. S/KEY).
        </div>
 
        <div class="main">
@@ -133,7 +107,7 @@
                        <td>
                        <table>
                        <tr> <td> Mateusz Kocielski &lt;<tt>m.kocielski%gmail.com@localhost</tt>&gt; </td> </tr>
-                       <tr> <td> $Id: index.html,v 1.1.1.1 2010/11/27 21:23:58 agc Exp $ </td> </tr>
+                       <tr> <td> $Id: index.html,v 1.2 2011/01/29 23:35:30 agc Exp $ </td> </tr>
                    </table>
                        </td>
                </tr>
diff -r 47bd94e51bdf -r 61d4585986d3 crypto/external/bsd/libsaslc/dist/man/libsaslc.3
--- a/crypto/external/bsd/libsaslc/dist/man/libsaslc.3  Sat Jan 29 23:19:54 2011 +0000
+++ b/crypto/external/bsd/libsaslc/dist/man/libsaslc.3  Sat Jan 29 23:35:30 2011 +0000
@@ -3,54 +3,64 @@
 .Dt LIBSASLC 3
 .Os
 .Sh NAME
-.Nm saslc_alloc ,
-.Nm saslc_init ,
-.Nm saslc_end ,
-.Nm saslc_strerror ,
-.Nm saslc_sess_strerror ,
-.Nm saslc_sess_init ,
-.Nm saslc_sess_end ,
-.Nm saslc_sess_setprop ,
-.Nm saslc_sess_getprop ,
-.Nm saslc_sess_getmech ,
-.Nm saslc_sess_cont ,
-.Nm saslc_sess_encode ,
-.Nm saslc_sess_decode 
+.Nm libsaslc
 .Nd Simple Authentication and Security Layer client library
 .Sh LIBRARY
 .Lb libsaslc
 .Sh SYNOPSIS
 .In saslc.h
 .Ft saslc_t *
-.Fn saslc_alloc "void" 
+.Fo saslc_alloc
+.Fa "void" 
+.Fc
 .Ft int
-.Fn saslc_end "saslc_t *ctx"
+.Fo saslc_end
+.Fa "saslc_t *ctx"
+.Fc
 .Ft int
-.Fn saslc_init "saslc_t *ctx" "const char *appname" 
+.Fo saslc_init
+.Fa "saslc_t *ctx" "const char *appname" 
+.Fc
 .Ft int
-.Fn saslc_sess_cont "saslc_sess_t *sess" "const void *in" "size_t inlen" \
-"void* *out" "size_t *outlen" 
+.Fo saslc_sess_cont
+.Fa "saslc_sess_t *sess" "const void *in" "size_t inlen" "void* *out" "size_t *outlen" 
+.Fc
 .Ft int
-.Fn saslc_sess_decode "saslc_sess_t *sess" "const void *in" "size_t inlen" \
-"void* *out" "size_t *outlen" 
+.Fo saslc_sess_decode
+.Fa "saslc_sess_t *sess" "const void *in" "size_t inlen" "void* *out" "size_t *outlen" 
+.Fc
 .Ft int
-.Fn saslc_sess_encode "saslc_sess_t *sess" "const void *in" "size_t inlen" \
-"void* *out" "size_t *outlen" 
+.Fo saslc_sess_encode
+.Fa "saslc_sess_t *sess" "const void *in" "size_t inlen" "void* *out" "size_t *outlen" 
+.Fc
 .Ft void
-.Fn saslc_sess_end "saslc_sess_t *sess" 
+.Fo saslc_sess_end
+.Fa "saslc_sess_t *sess" 
+.Fc
 .Ft const char *
-.Fn saslc_sess_getprop "saslc_sess_t *sess" "const char *name" 
+.Fo saslc_sess_getprop
+.Fa "saslc_sess_t *sess" "const char *name" 
+.Fc
 .Ft saslc_sess_t *
-.Fn saslc_sess_init "saslc_t *ctx" "const char *mechs" 
+.Fo saslc_sess_init
+.Fa "saslc_t *ctx" "const char *mechs" 
+.Fc
 .Ft int
-.Fn saslc_sess_setprop "saslc_sess_t *sess" "const char *name" \
-"const char *value"
+.Fo saslc_sess_setprop
+.Fa "saslc_sess_t *sess" "const char *name" "const char *value"
+.Fc
+.Ft const char *
+.Fo saslc_sess_strerror
+.Fa "saslc_sess_t *sess" 
+.Fc
 .Ft const char *
-.Fn saslc_sess_strerror "saslc_sess_t *sess" 
+.Fo saslc_sess_strmech
+.Fa "saslc_sess_t *sess" 
+.Fc
 .Ft const char *
-.Fn saslc_sess_strmech "saslc_sess_t *sess" 
-.Ft const char *
-.Fn saslc_strerror "saslc_t *ctx" 
+.Fo saslc_strerror
+.Fa "saslc_t *ctx" 
+.Fc
 .Sh DESCRIPTION
 The
 .Fn saslc_alloc
@@ -149,6 +159,6 @@
 .Sh STANDARDS
 RFC 2195, RFC 2222, RFC 2245, RFC 2595, RFC 2831
 .Sh OTHER IMPLEMENTATIONS
-There exist other SASL client library implementations include Cyrus SASL
+There exist other SASL client library implementations including Cyrus SASL
 (http://asg.web.cmu.edu/sasl/sasl-library.html) and GNU SASL
 (http://www.gnu.org/software/gsasl/).
diff -r 47bd94e51bdf -r 61d4585986d3 crypto/external/bsd/libsaslc/dist/soc.html
--- a/crypto/external/bsd/libsaslc/dist/soc.html        Sat Jan 29 23:19:54 2011 +0000
+++ b/crypto/external/bsd/libsaslc/dist/soc.html        Sat Jan 29 23:35:30 2011 +0000
@@ -240,7 +240,7 @@
                        <td>
                        <table>
                        <tr> <td> Mateusz Kocielski &lt;<tt>m.kocielski%gmail.com@localhost</tt>&gt; </td> </tr>
-                       <tr> <td> $Id: soc.html,v 1.1.1.1 2010/11/27 21:23:58 agc Exp $ </td> </tr>
+                       <tr> <td> $Id: soc.html,v 1.2 2011/01/29 23:35:30 agc Exp $ </td> </tr>
                    </table>
                        </td>
                </tr>
diff -r 47bd94e51bdf -r 61d4585986d3 crypto/external/bsd/libsaslc/dist/src/Makefile
--- a/crypto/external/bsd/libsaslc/dist/src/Makefile    Sat Jan 29 23:19:54 2011 +0000
+++ b/crypto/external/bsd/libsaslc/dist/src/Makefile    Sat Jan 29 23:35:30 2011 +0000
@@ -1,6 +1,6 @@
-# $Id: Makefile,v 1.1.1.1 2010/11/27 21:23:59 agc Exp $
-CC=gcc
-CFLAGS=-I../include -Wall -pedantic -fPIC -ggdb
+# $Id: Makefile,v 1.2 2011/01/29 23:35:31 agc Exp $
+
+CFLAGS=-I../include -Wall -Werror -pedantic -fPIC -ggdb -D_GNU_SOURCE
 LIBSASLC_OBJS=\
        dict.o error.o mech_anonymous.o mech_digestmd5.o mech_gssapi.o mech.o parser.o \
        xsess.o mech_crammd5.o mech_external.o mech_login.o mech_plain.o saslc.o crypto.o
@@ -13,3 +13,6 @@
 
 clean:
        rm -f *.o *.so
+
+splint:
+       splint -weak -I../include *.[ch]
diff -r 47bd94e51bdf -r 61d4585986d3 crypto/external/bsd/libsaslc/dist/src/Makefile.bsd
--- a/crypto/external/bsd/libsaslc/dist/src/Makefile.bsd        Sat Jan 29 23:19:54 2011 +0000
+++ b/crypto/external/bsd/libsaslc/dist/src/Makefile.bsd        Sat Jan 29 23:35:30 2011 +0000
@@ -1,10 +1,23 @@
-# $Id: Makefile.bsd,v 1.1.1.1 2010/11/27 21:23:59 agc Exp $
-WARNS?=4
+# $Id: Makefile.bsd,v 1.2 2011/01/29 23:35:31 agc Exp $
+
+.include <bsd.own.mk>
+
+USE_FORT?= yes
+
 LIB=saslc
-CPPFLAGS+=-I${.CURDIR}/../include
-SRCS= dict.c error.c mech_anonymous.c mech_digestmd5.c mech_gssapi.c mech.c \
-   parser.c xsess.c mech_crammd5.c mech_external.c mech_login.c \
-   mech_plain.c saslc.c crypto.c
+SRCS+= dict.c error.c mech_anonymous.c mech_digestmd5.c mech_gssapi.c mech.c
+SRCS+= parser.c xsess.c mech_crammd5.c mech_external.c mech_login.c
+SRCS+= mech_plain.c saslc.c crypto.c
+CPPFLAGS+=-I${EXTDIST}/include
+MAN=libsaslc.3
+WARNS?=4
+
+EXTDIST=${.CURDIR}/../dist
+
+.PATH: ${EXTDIST}/include ${EXTDIST}/src ${EXTDIST}/man
+
+INCS+= saslc.h
+INCSDIR=/usr/include
 
 LDADD+=-lssl -lgssapi
 DPADD+=${LIBSSL}
diff -r 47bd94e51bdf -r 61d4585986d3 crypto/external/bsd/libsaslc/dist/src/crypto.c
--- a/crypto/external/bsd/libsaslc/dist/src/crypto.c    Sat Jan 29 23:19:54 2011 +0000
+++ b/crypto/external/bsd/libsaslc/dist/src/crypto.c    Sat Jan 29 23:35:30 2011 +0000
@@ -1,4 +1,4 @@
-/* $Id: crypto.c,v 1.1.1.1 2010/11/27 21:23:59 agc Exp $ */
+/* $Id: crypto.c,v 1.2 2011/01/29 23:35:31 agc Exp $ */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -46,39 +46,40 @@
 #include <openssl/buffer.h>
 #include "crypto.h"
 
+/* local headers */
+
 #define HMAC_MD5_KEYSIZE       64
 #define HMAC_MD5_IPAD          0x36
 #define HMAC_MD5_OPAD          0x5C
 
-/* local header */
-
 static const char saslc__hex[] = "0123456789abcdef";
 
-static char * saslc__digest_to_ascii(const unsigned char *);
+static char *saslc__digest_to_ascii(const unsigned char *);
 
 /**
- * @brief converts MD5 binary digest into text representation.
- * @param d MD5 digest
+ * @brief converts MD5 binary digest into its text representation.
+ * @param d MD5 digest in binary form
  * @return the text representation, note that user is responsible for freeing
  * allocated memory.
  */
 
 static char *
-saslc__digest_to_ascii(const unsigned char *d)



Home | Main Index | Thread Index | Old Index