summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/krb5
diff options
context:
space:
mode:
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 d08c5b58515..89f778823d3 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 5bd14ce09d9..5e468f360a6 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 d1ffd577380..e0607745330 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 d0569647692..d5ac4883db1 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 1bf922baf67..7a8502727e3 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;