How to build OpenSSL for WP8?
AFAIK, we must replace winsock.h
by winsock2.h
because WP8 only supports winsock2.h
. And maybe we must replaces code to target WinRT architecture on WP8 (ThreadPool, ...)
The caveat is that we must build OpenSSL as WP8 static library, so that the output lib can be wrapped by WP8 runtime component, right ?
here is what you have to do, go to this link and download the VSbuild, now put that into the source files downloaded from the OpenSSL website, the folder structure should look like this:
apps bugs certs ..... vsbuild
once that is done, open the solution, it should upgrade it to VS12, change the settings to a Windows Phone RT build, to generate DLL's there is no need to build *_lib*, so change the other projects, most changes you need to do are to libeay32, do not compile openssl project, just ignore that, start by building libeay32, and start making changes to the code, as there are some functions we don't have in WinRT, you can either #ifdef
them out, or create your own functions,
NOTE for rand_win.c
change the functions to use rand_s
and #ifdef
most of the code there is, this might muck up the security, you will have to test it out yourself
Good Luck !