allow zero-length attribute values
non-dietlibc md5 workaround (using openssl)
This commit is contained in:
2
Makefile
2
Makefile
@@ -41,6 +41,8 @@ CFLAGS=-pipe -I. -Wall -W -g
|
||||
endif
|
||||
ifneq ($(DIET),)
|
||||
LIBS+=-llatin1
|
||||
else
|
||||
LIBS+=-lcrypto
|
||||
endif
|
||||
|
||||
%.o: %.c
|
||||
|
||||
7
auth.c
7
auth.c
@@ -1,7 +1,14 @@
|
||||
#ifdef __FreeBSD__
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef __dietlibc__
|
||||
#include <md5.h>
|
||||
#else
|
||||
#include <openssl/md5.h>
|
||||
#define MD5Init MD5_Init
|
||||
#define MD5Update MD5_Update
|
||||
#define MD5Final MD5_Final
|
||||
#endif
|
||||
#include "ldap.h"
|
||||
#include "auth.h"
|
||||
#include "str.h"
|
||||
|
||||
26
ldif_parse.c
26
ldif_parse.c
@@ -144,12 +144,15 @@ lookagain:
|
||||
} else if (c=='\n') {
|
||||
struct ldaprec* m;
|
||||
|
||||
if (!stralloc_0(&payload)) goto nomem;
|
||||
if (base64) {
|
||||
len=unbase64(payload.s);
|
||||
if (!binary) { payload.s[len]=0; ++len; }
|
||||
if (payload.len) {
|
||||
if (!stralloc_0(&payload)) goto nomem;
|
||||
if (base64) {
|
||||
len=unbase64(payload.s);
|
||||
if (!binary) { payload.s[len]=0; ++len; }
|
||||
} else
|
||||
len=n+1;
|
||||
} else
|
||||
len=n+1;
|
||||
len=0;
|
||||
|
||||
#if 0
|
||||
buffer_puts(buffer_2,"feld \"");
|
||||
@@ -199,12 +202,15 @@ lookagain:
|
||||
// buf[n]=0;
|
||||
#if 1
|
||||
|
||||
if (!stralloc_0(&payload)) goto nomem;
|
||||
if (base64) {
|
||||
len=unbase64(payload.s);
|
||||
if (!binary) { payload.s[len]=0; ++len; }
|
||||
if (payload.len) {
|
||||
if (!stralloc_0(&payload)) goto nomem;
|
||||
if (base64) {
|
||||
len=unbase64(payload.s);
|
||||
if (!binary) { payload.s[len]=0; ++len; }
|
||||
} else
|
||||
len=n+1;
|
||||
} else
|
||||
len=n+1;
|
||||
len=0;
|
||||
|
||||
#if 0
|
||||
buffer_puts(buffer_2,"feld \"");
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
#ifdef __FreeBSD__
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef __dietlibc__
|
||||
#include <md5.h>
|
||||
#else
|
||||
#include <openssl/md5.h>
|
||||
#define MD5Init MD5_Init
|
||||
#define MD5Update MD5_Update
|
||||
#define MD5Final MD5_Final
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include "buffer.h"
|
||||
#include "str.h"
|
||||
|
||||
@@ -11,7 +11,7 @@ long mstorage_add_bin(mstorage_t* p,const char* s,unsigned long n) {
|
||||
static char zero;
|
||||
long x;
|
||||
char intbuf[4];
|
||||
if (n==0) goto encodebinary;
|
||||
if (n==0 || (n==1 && s[0]==0)) goto encodebinary;
|
||||
for (i=0; i<n-1; ++i)
|
||||
if (!s[i]) {
|
||||
encodebinary:
|
||||
|
||||
Reference in New Issue
Block a user