summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdriaan de Jong <dejong@fox-it.com>2011-10-31 16:29:19 +0100
committerDavid Sommerseth <davids@redhat.com>2011-11-21 11:51:39 +0100
commit1d90851ed012775b6c85379ee263c5f6ffc2021e (patch)
tree200b0c631c2a21d3e180bba475ea7de130656396
parent7a8d707237bb18cb1c001205267f399772bdc840 (diff)
downloadopenvpn-1d90851ed012775b6c85379ee263c5f6ffc2021e.tar.gz
openvpn-1d90851ed012775b6c85379ee263c5f6ffc2021e.tar.xz
openvpn-1d90851ed012775b6c85379ee263c5f6ffc2021e.zip
Moved from strsep to strtok, for Windows compatibility
Signed-off-by: Adriaan de Jong <dejong@fox-it.com> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
-rw-r--r--ssl_polarssl.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/ssl_polarssl.c b/ssl_polarssl.c
index 9a8c49c..60d99a8 100644
--- a/ssl_polarssl.c
+++ b/ssl_polarssl.c
@@ -164,7 +164,7 @@ tls_ctx_set_options (struct tls_root_ctx *ctx, unsigned int ssl_flags)
void
tls_ctx_restrict_ciphers(struct tls_root_ctx *ctx, const char *ciphers)
{
- char *tmp_ciphers, *tmp_ciphers_orig;
+ char *tmp_ciphers, *tmp_ciphers_orig, *token;
int i, cipher_count;
int ciphers_len = strlen (ciphers);
@@ -182,11 +182,15 @@ tls_ctx_restrict_ciphers(struct tls_root_ctx *ctx, const char *ciphers)
/* Parse allowed ciphers, getting IDs */
i = 0;
tmp_ciphers_orig = tmp_ciphers = strdup(ciphers);
- while(tmp_ciphers) {
- ctx->allowed_ciphers[i] = ssl_get_ciphersuite_id (strsep (&tmp_ciphers, ":"));
- if (ctx->allowed_ciphers[i] != 0)
+
+ token = strtok (tmp_ciphers, ":");
+ while(token)
+ {
+ ctx->allowed_ciphers[i] = ssl_get_ciphersuite_id (token);
+ if (0 != ctx->allowed_ciphers[i])
i++;
- }
+ token = strtok (NULL, ":");
+ }
free(tmp_ciphers_orig);
}