diff options
author | Richard Levitte <levitte@openssl.org> | 2002-11-16 01:44:08 +0300 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2002-11-16 01:44:08 +0300 |
commit | 29ca164513f243025ccbc11bade8bfee5b49a543 (patch) | |
tree | b2eea1d839fcb69274ab57b0c371d46e6a399d28 /ssl | |
parent | 97d58eadbf2f05f86451da9a384a82dd73b97dce (diff) |
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 3d31bbf05f..1f122559ba 100644 --- a/ssl/ssl_cert.c +++ b/ssl/ssl_cert.c @@ -789,10 +789,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) { @@ -807,7 +827,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; @@ -825,6 +849,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 d8c8579d6f..ed163a22fb 100644 --- a/ssl/ssltest.c +++ b/ssl/ssltest.c @@ -143,6 +143,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" |