Add partial support for LDAP-prep Insignificant Character Handling
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22582 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,3 +1,12 @@
|
|||||||
|
2008-02-11 Love H<>rnquist <20>strand <lha@it.su.se>
|
||||||
|
|
||||||
|
* Add partial support for LDAP-prep Insignificant Character Handling
|
||||||
|
|
||||||
|
* normalize.c: use generated constant for length, check for
|
||||||
|
overruns, dont use gcc/c99 extentions
|
||||||
|
|
||||||
|
* gen-normalize.py, test-normalize.c: use generated constant for length
|
||||||
|
|
||||||
2008-02-05 Love H<>rnquist <20>strand <lha@it.su.se>
|
2008-02-05 Love H<>rnquist <20>strand <lha@it.su.se>
|
||||||
|
|
||||||
* utf8.c: Make wind_utf8ucs4_length() work again.
|
* utf8.c: Make wind_utf8ucs4_length() work again.
|
||||||
|
@@ -14,6 +14,7 @@ libwind_la_SOURCES = \
|
|||||||
errorlist_table.c \
|
errorlist_table.c \
|
||||||
map_table.c \
|
map_table.c \
|
||||||
map.c \
|
map.c \
|
||||||
|
ldap.c \
|
||||||
normalize.c \
|
normalize.c \
|
||||||
normalize_table.c \
|
normalize_table.c \
|
||||||
punycode.c \
|
punycode.c \
|
||||||
@@ -59,6 +60,7 @@ check_PROGRAMS = \
|
|||||||
test-normalize \
|
test-normalize \
|
||||||
test-prohibited \
|
test-prohibited \
|
||||||
test-punycode \
|
test-punycode \
|
||||||
|
test-ldap \
|
||||||
test-utf8
|
test-utf8
|
||||||
|
|
||||||
test_punycode_SOURCES = \
|
test_punycode_SOURCES = \
|
||||||
|
@@ -62,6 +62,7 @@ wind_stringprep(const uint32_t *in, size_t in_len,
|
|||||||
size_t tmp_len = in_len * 3;
|
size_t tmp_len = in_len * 3;
|
||||||
uint32_t *tmp = malloc(tmp_len * sizeof(uint32_t));
|
uint32_t *tmp = malloc(tmp_len * sizeof(uint32_t));
|
||||||
int ret;
|
int ret;
|
||||||
|
size_t olen;
|
||||||
|
|
||||||
if (tmp == NULL)
|
if (tmp == NULL)
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
@@ -71,17 +72,39 @@ wind_stringprep(const uint32_t *in, size_t in_len,
|
|||||||
free(tmp);
|
free(tmp);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
ret = _wind_stringprep_normalize(tmp, tmp_len, out, out_len);
|
|
||||||
|
olen = *out_len;
|
||||||
|
ret = _wind_stringprep_normalize(tmp, tmp_len, tmp, &olen);
|
||||||
|
if (ret) {
|
||||||
|
free(tmp);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
ret = _wind_stringprep_prohibited(tmp, olen, flags);
|
||||||
|
if (ret) {
|
||||||
|
free(tmp);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
ret = _wind_stringprep_testbidi(tmp, olen, flags);
|
||||||
|
if (ret) {
|
||||||
|
free(tmp);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Insignificant Character Handling for ldap-prep */
|
||||||
|
if (flags & WIND_PROFILE_LDAP_CASE_EXACT_ATTRIBUTE) {
|
||||||
|
ret = _wind_ldap_case_exact_attribute(tmp, olen, out, out_len);
|
||||||
|
#if 0
|
||||||
|
} else if (flags & WIND_PROFILE_LDAP_CASE_EXACT_ASSERTION) {
|
||||||
|
} else if (flags & WIND_PROFILE_LDAP_NUMERIC) {
|
||||||
|
} else if (flags & WIND_PROFILE_LDAP_TELEPHONE) {
|
||||||
|
} else {
|
||||||
|
#endif
|
||||||
|
memcpy(out, tmp, sizeof(out[0]) * olen);
|
||||||
|
*out_len = olen;
|
||||||
|
}
|
||||||
free(tmp);
|
free(tmp);
|
||||||
if (ret)
|
|
||||||
return ret;
|
return ret;
|
||||||
ret = _wind_stringprep_prohibited(out, *out_len, flags);
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
ret = _wind_stringprep_testbidi(out, *out_len, flags);
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
|
@@ -18,6 +18,7 @@ HEIMDAL_WIND_1.0 {
|
|||||||
_wind_stringprep_prohibited;
|
_wind_stringprep_prohibited;
|
||||||
_wind_stringprep_map;
|
_wind_stringprep_map;
|
||||||
_wind_stringprep_normalize;
|
_wind_stringprep_normalize;
|
||||||
|
_wind_ldap_case_exact_attribute;
|
||||||
_wind_ucs2read;
|
_wind_ucs2read;
|
||||||
local:
|
local:
|
||||||
*;
|
*;
|
||||||
|
@@ -39,11 +39,19 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include <wind_err.h>
|
||||||
|
|
||||||
typedef unsigned int wind_profile_flags;
|
typedef unsigned int wind_profile_flags;
|
||||||
|
|
||||||
#define WIND_PROFILE_NAME 1
|
#define WIND_PROFILE_NAME 0x00000001
|
||||||
#define WIND_PROFILE_LDAP 2
|
#define WIND_PROFILE_SASL 0x00000002
|
||||||
#define WIND_PROFILE_SASL 4
|
#define WIND_PROFILE_LDAP 0x00000004
|
||||||
|
|
||||||
|
#define WIND_PROFILE_LDAP_CASE_EXACT_ATTRIBUTE 0x00010000
|
||||||
|
#define WIND_PROFILE_LDAP_CASE_EXACT_ASSERTION 0x00020000
|
||||||
|
#define WIND_PROFILE_LDAP_NUMERIC 0x00040000
|
||||||
|
#define WIND_PROFILE_LDAP_TELEPHONE 0x00080000
|
||||||
|
|
||||||
|
|
||||||
/* flags to wind_ucs2read/wind_ucs2write */
|
/* flags to wind_ucs2read/wind_ucs2write */
|
||||||
#define WIND_RW_LE 1
|
#define WIND_RW_LE 1
|
||||||
|
@@ -57,4 +57,8 @@ int _wind_stringprep_map(const uint32_t *, size_t,
|
|||||||
|
|
||||||
int _wind_stringprep_normalize(const uint32_t *, size_t, uint32_t *, size_t *);
|
int _wind_stringprep_normalize(const uint32_t *, size_t, uint32_t *, size_t *);
|
||||||
|
|
||||||
|
int _wind_ldap_case_exact_attribute(const uint32_t *, size_t,
|
||||||
|
uint32_t *, size_t *);
|
||||||
|
|
||||||
|
|
||||||
#endif /* _WINDLOCL_H_ */
|
#endif /* _WINDLOCL_H_ */
|
||||||
|
Reference in New Issue
Block a user