strongswan | 支持国密sm1,sm2,sm3,sm4算法的ipsec vpn。

 by   zhangke5959 C Version: Current License: Non-SPDX

kandi X-RAY | strongswan Summary

kandi X-RAY | strongswan Summary

strongswan is a C library. strongswan has no bugs and it has low support. However strongswan has 20 vulnerabilities and it has a Non-SPDX License. You can download it from GitHub.

1,这是一个基于strongswan的支持国密算法sm1,sm2, sm3,sm4 的开源ipsec vpn 2,添加了gmalg插件,用于支持软算法 sm2, sm3, sm4 3,修改了pki工具,添加了支持sm2的各种证书生成读取 4,pki工具也添加了crypto命令,用于测试国密算法 5,strongswan支持使用TUN设备的应用层IPSec功能和基于内核xfrm的IPSec功能,由于内核xfrm需 要内核加密支持另外写了一个soft_alg的内核加密驱动,使其内核支持sm3和sm4,便于测试, 后面测试案例采用,TUN设备的应用层IPSec,但内核xfrm也是完全支持的,仅需修改配置,加载 驱动即可. 添加目录:build.sh 编译脚本 testing/tests/gmalg 这个是测试脚本 src/libstrongswan/plugins/gmalg 这是strongswan的加密算法插件框架 src/libstrongswan/plugins/gmalg/gmalg 这是sm2,sm3,sm4的软算法实现. 为了方便,将软算法的源代码放在了gmalg插件里,但也可以改用动态库形式,只需在configuie 命令后 面添加 --with-gmalg_interior=no参数即可,但要提供libgmalg.so 动态库及gmalg.h 头文件. libgmalg.so可以有src/libstrongswan/plugins/gmalg/gmalg目录的源码生成,只需要在这个目录make就可 以, 生成文件在src/libstrongswan/plugins/gmalg/gmalg目录的.obj目录里面。如需替换软算法,修改 gmalg.c文件即可. 编译软件: 1,在strongswan目录运行autogen.sh命令。生成configuie命令 2,在主机的根系统上创建 /ipsec 目录,添加权限 chmod 777 /ipsec 3,在strongswan目录运行autogen.sh命令。配置,编译及安装strongswan 4,将/ipsec目录打包拷贝到server和client上,必须解压到根目录,比如pki命令, /ipsec/bin/pki 5,尽量不要用软件默认路径安装,便于删除和更新. 测试脚本在testing/tests/gmalg目录,测试步骤如下: 1,进入testing/tests/gmalg/ipsec_cert目录,运行sm2.sh命令,生成所需的所有证书,包括客户端和主机端 运行local.sh 加载文件到所需目录,这里注意,只生成一次,客户端和主机端加载的ca证书相同,不然验证不过 2,在服务端:运行src/libstrongswan/plugins/gmalg 目录下的init_server.sh脚本,初始化环境 3,在客户端:运行src/libstrongswan/plugins/gmalg 目录下的init_client.sh脚本,初始化环境 4,两端同时运行运行src/libstrongswan/plugins/gmalg 目录下的run.sh脚本,启动软件. 使用内核xfrm 的配置: 编译soft_alg驱动模块并加载 服务端和客户端运行testing/tests/gmalg/libipsec/run_libipsec.sh脚本,修改配置即可.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              strongswan has a low active ecosystem.
              It has 70 star(s) with 60 fork(s). There are 11 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 13 open issues and 8 have been closed. On average issues are closed in 148 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of strongswan is current.

            kandi-Quality Quality

              strongswan has no bugs reported.

            kandi-Security Security

              strongswan has 20 vulnerability issues reported (1 critical, 9 high, 9 medium, 1 low).

            kandi-License License

              strongswan has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              strongswan releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of strongswan
            Get all kandi verified functions for this library.

            strongswan Key Features

            No Key Features are available at this moment for strongswan.

            strongswan Examples and Code Snippets

            No Code Snippets are available at this moment for strongswan.

            Community Discussions

            QUESTION

            strongswan: What is the difference between left and leftid?
            Asked 2021-Feb-24 at 02:34

            This tutorial use left parameter when setup strongswan, while this tutorial also use leftid parameter. What is the difference between left and leftid?

            ...

            ANSWER

            Answered 2021-Feb-24 at 02:34

            QUESTION

            My systemd unit file and bash scripts not working for interface ppp0 checks
            Asked 2020-Nov-20 at 16:40

            Trying to understand systemd and craft a service that works , using two bash scripts I have to down/up an IPsec/L2tpd tunnel. All works fine if I use the bash scripts commands from the command line, but for some reason I'm getting race conditions or lack of sync or something because using my systemd unit file is random and intermittent often requiring a random number of restarts to get it working.

            vpn-disconnect.sh ...

            ANSWER

            Answered 2020-Nov-20 at 16:06

            It does not look like a good idea to start VPN as a service. It is possible indeed but the service is supposed to start on system boot, so you have to cope with dependency on network etc.

            Since your scripts work OK in standalone mode, I would suggest to use them as up/down hooks for a main network interface (see e.g. Run script when eth0 UP).

            P.S. In this line

            Source https://stackoverflow.com/questions/64920825

            QUESTION

            strongswan ipsec can't ping subnets
            Asked 2020-Sep-26 at 12:45

            I have 2 strongswan connected, each can ping the other. My problem comes when either of the subnets want to ping an ip on the other side, it doesn't happen. I know i need to add some masquerading but i can't figure out how (i have added the routes on the other network elements with route add -net x.x.x.x/x gw x.x.x.x)

            Side A:

            ...

            ANSWER

            Answered 2020-Sep-26 at 12:45

            So i needed to:

            on the gw with subnet 10.10.0.0/24:

            Source https://stackoverflow.com/questions/64072497

            QUESTION

            VPN to Azure gateway connects but does not resolve addresses
            Asked 2020-Aug-02 at 11:39

            I have set up a VPN to an Azure IKEv2 gateway following instructions from these sites:

            full tutorial

            Create Certificate

            I had originally used the StrongSwan Gui version but after checking found that none of the configuration mentioned in the cli version had been completed so I worked through the cli version. When I start the VPN I get no errors and I can see logs in syslog that indicate the connection is set up. When I browse to a page that I need the connection for I get an error page stating DNS error. It has connected on more than one occasion and I have used the page but then if I turn it off and start it up again it does not work. I haven't found a pattern for it working yet and seems to be genuinely random.

            I am on Ubuntu Linux

            ...

            ANSWER

            Answered 2020-Aug-02 at 11:39

            Finally I have figured this out. The last problem I had was a DNS problem setting dns server from Azure gateway. To fix this I had to install resolvconf and configure it for dynamic updates.

            I had to:

            1. install and configure strongswan (best instructions I found)
            2. set mss/mtu in the charon configuration (as mentioned in this post)
            3. Install & configure resolvconf (as in answer here)
            4. Set up network manager vpn (The graphical element for top right of menu)

            when that is done I bring up the connection

            Source https://stackoverflow.com/questions/63191778

            QUESTION

            Site-to-site VPN on GCP using Strongswan
            Asked 2020-Jul-28 at 06:34

            I have installed strongswan VPN on GCP Compute engine(Ubuntu 20.04) by referring https://www.digitalocean.com/community/tutorials/how-to-set-up-an-ikev2-vpn-server-with-strongswan-on-ubuntu-20-04

            have 3 different projects and I set up a tunnel for all from Strongswan VPN Compute Engine.

            below is the ipsec.conf file

            ...

            ANSWER

            Answered 2020-Jul-28 at 06:34

            On GCP Compute Engine IP Forwarding was off, so that was the problem.

            I take a snapshot of the Compute Engine and create new one using it and mark IP forwarding to ON.

            Source https://stackoverflow.com/questions/63104415

            QUESTION

            How does IKEv2 work on Android without raw sockets
            Asked 2020-Jun-19 at 12:48

            I was exploring the IKEv2 StrongSwan client implementation for Android. What I fail to understand is that Android and Java do not support raw sockets, whilst the IKEv2 / IPSec works below Transport layer, which seems counter-intuitive. How exactly does the communication happen after the CHILD_SA aka IPSec SA is established?

            References:

            1. The official documentation for IKE Charon keying daemon does mention the use of socket in the architecture diagram, but I was unable to find any further reference to it.
            2. I'm aware of the fact that StrongSwan's Android client uses a user-space implementation of libipsec, but again how does libipsec communicate without raw sockets?

            Any help to fill the gap in my understanding is much appreciated!

            ...

            ANSWER

            Answered 2020-Jun-19 at 12:48

            The client only supports UDP-encapsulated ESP. These packets are sent/received over the same UDP sockets that are already used for IKEv2. This limitation is mentioned on the app's wiki page.

            Source https://stackoverflow.com/questions/62454058

            QUESTION

            SC create binpath error
            Asked 2020-Apr-19 at 20:21

            I am trying to run the following command in the PowerShell

            ...

            ANSWER

            Answered 2018-Oct-04 at 00:30

            I ran into this also. It looks like the error happens at line:1 char:1. So I assumed it doesn't understand what "sc" is. So I changed sc create .. to sc.exe create .. and it worked for my service.

            Source https://stackoverflow.com/questions/51062160

            QUESTION

            How to create IPSec/L2TP psk vpn for android
            Asked 2020-Feb-11 at 11:03

            I need to connect a Vpn programmatically in my app, but can't seem to find a way. I see VpnService, StrongSwan, OpenVpn but this seems not IPSec. How do I go about connecting to my already build IPSec and L2TP servers that have a username, password and pre shared key.

            ...

            ANSWER

            Answered 2018-Apr-25 at 12:53

            You can not do it in the latest versions of Android. It could be done via SystemProperties.java class which has API available for these connections, but these API are now hidden in the latest Android versions due to Security risks.

            However if the phone is rooted then you can use it via hacks like reflection etc to access those System properties and get everything going.

            Source https://stackoverflow.com/questions/50021979

            QUESTION

            JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception java.lang.ClassNotFoundException:
            Asked 2019-Oct-04 at 06:13

            I am working on VPN app and follows the code of strongswan app. I have used the code of this app and it is loading .so files through JNI and i have copied these files from the strongswan project. It gives this exception for one of these files:

            ...

            ANSWER

            Answered 2018-Dec-13 at 07:59

            Package name in the exception is the package name of the project from where i copied the code. "org.strongswan.android.logic.CharonVpnService"

            but my app's package name is "com.whizpool.vpn.logic.CharonVpnService".

            No, you cannot do this. You have to specify the package name and class name exactly the same as the one referenced inside JNI code. The shared libraries, i.e. the .so files, have to match well with the correct Jar library because of the package name and class name are the unique references from C side to refer back to Java side.

            Source https://stackoverflow.com/questions/53755504

            QUESTION

            Creating ESP packet using C openssl AES-GCM encryption throws wrong ICV
            Asked 2019-Jun-25 at 00:51

            I'm trying to encrypt my ICMP packet with AES128-CCM16. I used c openssl library for encryption. But encrypted result is wrong!

            I used two Linux 18.04 VM for simulating ESP packet with strongswan IPsec. I captured ESP packet and printed my whole variables in my decrypt function.

            ...

            ANSWER

            Answered 2019-Jun-25 at 00:51

            I solved problem. So answer myself

            Before EVP_EncryptInit_ex(...), below code should be inserted.

            Source https://stackoverflow.com/questions/56733074

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install strongswan

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/zhangke5959/strongswan.git

          • CLI

            gh repo clone zhangke5959/strongswan

          • sshUrl

            git@github.com:zhangke5959/strongswan.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link