summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/krb5
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-01-31 15:59:06 +1100
committerAndrew Bartlett <abartlet@samba.org>2011-02-02 15:19:03 +1100
commit2d9bcc861d6b2cd67d7c6439e90d9ac4a600f0f2 (patch)
treece681728eb91875b60b70d34247a0f07772ec411 /source4/heimdal/lib/krb5
parent3d4a9ddc244bd4937af9ff1c6e898ab45a7d28b5 (diff)
downloadsamba-2d9bcc861d6b2cd67d7c6439e90d9ac4a600f0f2.tar.gz
samba-2d9bcc861d6b2cd67d7c6439e90d9ac4a600f0f2.tar.bz2
samba-2d9bcc861d6b2cd67d7c6439e90d9ac4a600f0f2.zip
s4:heimdal: import lorikeet-heimdal-201101310455 (commit aa88eb1a05c4985cc23fb65fc1bad75bdce01c1f)
Diffstat (limited to 'source4/heimdal/lib/krb5')
-rw-r--r--source4/heimdal/lib/krb5/config_file.c7
-rw-r--r--source4/heimdal/lib/krb5/crypto-algs.c4
-rw-r--r--source4/heimdal/lib/krb5/keytab.c41
-rw-r--r--source4/heimdal/lib/krb5/keytab_any.c2
-rw-r--r--source4/heimdal/lib/krb5/pkinit.c14
5 files changed, 49 insertions, 19 deletions
diff --git a/source4/heimdal/lib/krb5/config_file.c b/source4/heimdal/lib/krb5/config_file.c
index d08c5b5851..89f778823d 100644
--- a/source4/heimdal/lib/krb5/config_file.c
+++ b/source4/heimdal/lib/krb5/config_file.c
@@ -877,12 +877,7 @@ next_component_string(char * begin, char * delims, char **state)
end = begin;
while (*end == '"') {
- char * t;
- while ((t = strchr(end + 1, '"')) != NULL && *(t - 1) == '\\') {
- --t;
- memmove(t, t + 1, strlen(t));
- end = t;
- }
+ char * t = strchr(end + 1, '"');
if (t)
end = ++t;
diff --git a/source4/heimdal/lib/krb5/crypto-algs.c b/source4/heimdal/lib/krb5/crypto-algs.c
index 5bd14ce09d..5e468f360a 100644
--- a/source4/heimdal/lib/krb5/crypto-algs.c
+++ b/source4/heimdal/lib/krb5/crypto-algs.c
@@ -74,9 +74,9 @@ struct encryption_type *_krb5_etypes[] = {
&_krb5_enctype_old_des3_cbc_sha1,
#endif
#ifdef HEIM_WEAK_CRYPTO
- &_krb5_enctype_des_cbc_crc,
- &_krb5_enctype_des_cbc_md4,
&_krb5_enctype_des_cbc_md5,
+ &_krb5_enctype_des_cbc_md4,
+ &_krb5_enctype_des_cbc_crc,
&_krb5_enctype_des_cbc_none,
&_krb5_enctype_des_cfb64_none,
&_krb5_enctype_des_pcbc_none,
diff --git a/source4/heimdal/lib/krb5/keytab.c b/source4/heimdal/lib/krb5/keytab.c
index d1ffd57738..e060774533 100644
--- a/source4/heimdal/lib/krb5/keytab.c
+++ b/source4/heimdal/lib/krb5/keytab.c
@@ -164,6 +164,36 @@ krb5_kt_register(krb5_context context,
return 0;
}
+static const char *
+keytab_name(const char * name, const char ** ptype, size_t * ptype_len)
+{
+ const char * residual;
+
+ residual = strchr(name, ':');
+
+ if (residual == NULL
+
+#ifdef _WIN32
+
+ /* Avoid treating <drive>:<path> as a keytab type
+ * specification */
+
+ || name + 1 == residual
+#endif
+ ) {
+
+ *ptype = "FILE";
+ *ptype_len = strlen(*ptype);
+ residual = name;
+ } else {
+ *ptype = name;
+ *ptype_len = residual - name;
+ residual++;
+ }
+
+ return residual;
+}
+
/**
* Resolve the keytab name (of the form `type:residual') in `name'
* into a keytab in `id'.
@@ -189,16 +219,7 @@ krb5_kt_resolve(krb5_context context,
size_t type_len;
krb5_error_code ret;
- residual = strchr(name, ':');
- if(residual == NULL) {
- type = "FILE";
- type_len = strlen(type);
- residual = name;
- } else {
- type = name;
- type_len = residual - name;
- residual++;
- }
+ residual = keytab_name(name, &type, &type_len);
for(i = 0; i < context->num_kt_types; i++) {
if(strncasecmp(type, context->kt_types[i].prefix, type_len) == 0)
diff --git a/source4/heimdal/lib/krb5/keytab_any.c b/source4/heimdal/lib/krb5/keytab_any.c
index d056964769..d5ac4883db 100644
--- a/source4/heimdal/lib/krb5/keytab_any.c
+++ b/source4/heimdal/lib/krb5/keytab_any.c
@@ -61,7 +61,7 @@ any_resolve(krb5_context context, const char *name, krb5_keytab id)
char buf[256];
while (strsep_copy(&name, ",", buf, sizeof(buf)) != -1) {
- a = malloc(sizeof(*a));
+ a = calloc(1, sizeof(*a));
if (a == NULL) {
ret = ENOMEM;
goto fail;
diff --git a/source4/heimdal/lib/krb5/pkinit.c b/source4/heimdal/lib/krb5/pkinit.c
index 1bf922baf6..7a8502727e 100644
--- a/source4/heimdal/lib/krb5/pkinit.c
+++ b/source4/heimdal/lib/krb5/pkinit.c
@@ -2214,7 +2214,21 @@ _krb5_parse_moduli(krb5_context context, const char *file,
if (file == NULL)
file = MODULI_FILE;
+#ifdef KRB5_USE_PATH_TOKENS
+ {
+ char * exp_file;
+
+ if (_krb5_expand_path_tokens(context, file, &exp_file) == 0) {
+ f = fopen(exp_file, "r");
+ krb5_xfree(exp_file);
+ } else {
+ f = NULL;
+ }
+ }
+#else
f = fopen(file, "r");
+#endif
+
if (f == NULL) {
*moduli = m;
return 0;