如何为 WP8 构建 OpenSSL? [英] How to build OpenSSL for WP8?

查看:19
本文介绍了如何为 WP8 构建 OpenSSL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为 WP8 构建 OpenSSL?

AFAIK,我们必须用 winsock2.h 替换 winsock.h 因为 WP8 只支持 winsock2.h.也许我们必须替换代码以针对 WP8 上的 WinRT 架构(线程池,...)

需要注意的是,我们必须将 OpenSSL 构建为 WP8 静态库,以便 WP8 运行时组件可以包装输出库,对吗?

解决方案

这是你必须做的,去此链接并下载VSbuild,现在将其放入从OpenSSL网站下载的源文件中,文件夹结构应如下所示:

<块引用>

 应用程序错误证书.....vsbuild

一旦完成,打开解决方案,它应该将其升级到VS12,将设置更改为Windows Phone RT build,生成DLL的不需要构建*_lib*,因此更改其他项目,大部分更改您需要做的是 libeay32,不要编译 openssl 项目,忽略它,从构建 libeay32 开始,然后开始对代码,因为有些函数我们在 WinRT 中没有,你可以#ifdef 把它们去掉,或者创建你自己的函数,

注意 rand_win.c 更改函数以使用 rand_s#ifdef 那里的大部分代码是的,这可能会破坏安全性,您必须自己进行测试

祝你好运!

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 !

这篇关于如何为 WP8 构建 OpenSSL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆