win10 linux 子系统 及 Fizz (tls1.3实现代码) 编译

启用linux子系统步骤:

控制面板 =》 程序与功能 =》关闭和启用windows功能 =》 从列表里面找到linux子系统项,然后勾上,确定,装完重启。

 

重启后, 可以通过在cmd控制台中输入 bash 来打开shell。

查看版本:

[email protected]:/mnt/c/Users/lenovo$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial

 

win10 linux 子系统 及 Fizz (tls1.3实现代码) 编译

升级重装:

lxrun /uninstall /full /y        #先卸载旧的

lxrun /install /y                   #或者从windows app store 搜索 ubuntu 来下载安装,约200M左右

 

添加下载源:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak #备份
sudo vim /etc/apt/sources.list #修改

# 添加阿里软件源地址:

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get install software-properties-common

sudo apt-get update #刷新系统下载源

 

准备编译工具和相关库:

apt install g++

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created

晦气~~~pepepe!!!!!

https://mirrors.ustc.edu.cn/ubuntu/

手动下载deb包,dpkg -i xxx.deb

 

sudo apt-get install \
    cmake \
    libboost-all-dev \
    libevent-dev \
    libdouble-conversion-dev \
    libgoogle-glog-dev \
    libgflags-dev \
    libiberty-dev \
    liblz4-dev \
    liblzma-dev \
    libsnappy-dev \
    make \
    zlib1g-dev \
    binutils-dev \
    libjemalloc-dev \
    libssl-dev \
    pkg-config

 

两个库无可用软件源,得下载源码编译安装:

libsodium
folly

先编译安装 libsodium

 

 

搞半天, 适版的g++都没装上, linux 竟还是这么扯。。。

 

最后, 换了份代码, 不试Fizz了, 改用 WOLFSSL 测试。。。。。

https://github.com/wolfSSL/wolfssl

https://www.wolfssl.com

 

WOLFSSL_TLS13
HAVE_HKDF
HAVE_FFDHE_2048
WC_RSA_PSS
enable-sniffer
 

 

加上这几个预编译宏,可以直接用vs2015编译出exe来玩