Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

How does StrongSwan enable different crypto libraries?

share|improve this question
add comment

2 Answers

By default, strongSwan uses its own implementations for cryptographic algorithms. These are provided by e.g. the aes, sha1 and sha2 plugins. The default implementation for public key cryptography (RSA, DH) is provided by the gmp plugin, which relies on libgmp.

Enabling the openssl or gcrypt plugins, while not-building or not-loading the default plugins, allows to replace the default implementations with those provided by the respective libraries (libcrypto/OpenSSL or libgcrypt). The actual features provided by these plugins depend on how the underlying library was built, for instance, if OpenSSL was built with support for Elliptic Curve Cryptography (ECDSA, ECDH).

You can check which features each plugin provides with ipsec listplugins after starting the IKE daemon with ipsec start. The currently used implementation for each cryptographic primitive can be listed with ipsec listalgs (this depends on the order in which plugins are loaded, the first implementation will be used).

It's important to note that these plugins are only used for the key exchange (IKE, ike keyword in ipsec.conf). The ESP traffic is handled directly by the operating system's IPsec stack, for instance, the Linux kernel, which provides its own modularized crypto framework.

The parameters you may use in ipsec.conf depend only on the availability of a specific algorithm, either provided by any of the plugins (IKE) or by the operating system's kernel (ESP). All supported algorithms/keywords and their availability in plugins and (Linux) kernel can be found on the strongSwan wiki.

share|improve this answer
    
Does GMP support constant time arithmetic? General purpose big integer libraries usually don't, leading to side-channel attacks when used in cryptography. –  CodesInChaos Jul 3 '13 at 12:39
1  
It does for some operations. For instance, strongSwan's gmp plugin uses mpz_powm_sec, if available, when signing with RSA or computing DH secrets. –  ecdsa Jul 3 '13 at 16:40
add comment

Unless you've got a pressing reason to, I'd suggest that if you're trying to configure something like an IPSEC tunnel for the first time, stick to default values as much as possible, it'll make the process easier.

That said if you need to use gcrypt with strongswan, they have configuration examples for that scenario on their site here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.