summaryrefslogtreecommitdiffstats
path: root/src/openvpn/crypto_polarssl.c
diff options
context:
space:
mode:
authorSteffan Karger <steffan@karger.me>2014-11-08 11:15:08 +0100
committerGert Doering <gert@greenie.muc.de>2014-11-08 18:29:33 +0100
commit44294568a113a7c54ce7fca86b4014c9d1168888 (patch)
tree7fb59918437919eb5a0f8e06d13d00e7c3e71165 /src/openvpn/crypto_polarssl.c
parentb677a3dfe53a647440b376670e03b16201279e87 (diff)
downloadopenvpn-44294568a113a7c54ce7fca86b4014c9d1168888.tar.gz
openvpn-44294568a113a7c54ce7fca86b4014c9d1168888.tar.xz
openvpn-44294568a113a7c54ce7fca86b4014c9d1168888.zip
Fix assertion error when using --cipher none
Some commits ago, the cipher mode checks were cleaned up to remove code duplication (and fix the issue in #471), but broke '--cipher none' (reported in #473). This commit fixes that. Signed-off-by: Steffan Karger <steffan@karger.me> Acked-by: Arne Schwabe <arne@rfc2549.org> Message-Id: <545DED2C.5070002@karger.me> URL: http://article.gmane.org/gmane.network.openvpn.devel/9217 Signed-off-by: Gert Doering <gert@greenie.muc.de> (cherry picked from commit 4e93e6dc88f4d904a4f2eb90140472a8d8fd68d0)
Diffstat (limited to 'src/openvpn/crypto_polarssl.c')
-rw-r--r--src/openvpn/crypto_polarssl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/openvpn/crypto_polarssl.c b/src/openvpn/crypto_polarssl.c
index 8bf8d8d..af79029 100644
--- a/src/openvpn/crypto_polarssl.c
+++ b/src/openvpn/crypto_polarssl.c
@@ -419,13 +419,13 @@ cipher_kt_mode (const cipher_info_t *cipher_kt)
bool
cipher_kt_mode_cbc(const cipher_kt_t *cipher)
{
- return cipher_kt_mode(cipher) == OPENVPN_MODE_CBC;
+ return cipher && cipher_kt_mode(cipher) == OPENVPN_MODE_CBC;
}
bool
cipher_kt_mode_ofb_cfb(const cipher_kt_t *cipher)
{
- return (cipher_kt_mode(cipher) == OPENVPN_MODE_OFB ||
+ return cipher && (cipher_kt_mode(cipher) == OPENVPN_MODE_OFB ||
cipher_kt_mode(cipher) == OPENVPN_MODE_CFB);
}