diff options
author | Richard Levitte <levitte@openssl.org> | 2002-11-15 22:37:18 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2002-11-15 22:37:18 +0000 |
commit | 0bf23d9b2055223c6e7a1398d2243a65dfa4c30d (patch) | |
tree | cd3b00d88ebc55c0ea232b6f43200097f20a16de /ssl | |
parent | 813f256783a678b131a81ed1c8d05b70395a6255 (diff) | |
download | openssl-0bf23d9b2055223c6e7a1398d2243a65dfa4c30d.tar.gz |
WinCE patches
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/ssl_cert.c | 28 | ||||
-rw-r--r-- | ssl/ssltest.c | 3 |
2 files changed, 31 insertions, 0 deletions
diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c index c6dbc94d65..b0e20ed941 100644 --- a/ssl/ssl_cert.c +++ b/ssl/ssl_cert.c @@ -818,10 +818,30 @@ int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, WIN32_FIND_DATA FindFileData; HANDLE hFind; int ret = 0; +#ifdef OPENSSL_SYS_WINCE + WCHAR* wdir = NULL; +#endif CRYPTO_w_lock(CRYPTO_LOCK_READDIR); +#ifdef OPENSSL_SYS_WINCE + /* convert strings to UNICODE */ + { + BOOL result = FALSE; + int i; + wdir = malloc((strlen(dir)+1)*2); + if (wdir == NULL) + goto err_noclose; + for (i=0; i<(int)strlen(dir)+1; i++) + wdir[i] = (short)dir[i]; + } +#endif + +#ifdef OPENSSL_SYS_WINCE + hFind = FindFirstFile(wdir, &FindFileData); +#else hFind = FindFirstFile(dir, &FindFileData); +#endif /* Note that a side effect is that the CAs will be sorted by name */ if(hFind == INVALID_HANDLE_VALUE) { @@ -836,7 +856,11 @@ int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, char buf[1024]; int r; +#ifdef OPENSSL_SYS_WINCE + if(strlen(dir)+_tcslen(FindFileData.cFileName)+2 > sizeof buf) +#else if(strlen(dir)+strlen(FindFileData.cFileName)+2 > sizeof buf) +#endif { SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK,SSL_R_PATH_TOO_LONG); goto err; @@ -854,6 +878,10 @@ int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, err: FindClose(hFind); err_noclose: +#ifdef OPENSSL_SYS_WINCE + if (wdir != NULL) + free(wdir); +#endif CRYPTO_w_unlock(CRYPTO_LOCK_READDIR); return ret; } diff --git a/ssl/ssltest.c b/ssl/ssltest.c index 3718c1389d..035a4d2deb 100644 --- a/ssl/ssltest.c +++ b/ssl/ssltest.c @@ -148,6 +148,9 @@ #ifdef OPENSSL_SYS_VMS # define TEST_SERVER_CERT "SYS$DISK:[-.APPS]SERVER.PEM" # define TEST_CLIENT_CERT "SYS$DISK:[-.APPS]CLIENT.PEM" +#elif defined(OPENSSL_SYS_WINCE) +# define TEST_SERVER_CERT "\\OpenSSL\\server.pem" +# define TEST_CLIENT_CERT "\\OpenSSL\\client.pem" #else # define TEST_SERVER_CERT "../apps/server.pem" # define TEST_CLIENT_CERT "../apps/client.pem" |