[strongSwan] [Strongswan]expected hash algorithm HASH_SHA1, but found HASH_SHA256 error

Martin Willi martin at strongswan.org
Thu Sep 27 14:27:53 CEST 2012


Hi,

> Whether Certificate signing using SHA256 is supported in Strongswan.

strongSwan can use and verify certificates signed with SHA256, and it
can issue certificates using SHA256 with our pki tool.

> src/libcharon/sa/ikev2/authenticators/pubkey_authenticator.c
> 
>     switch (private->get_type(private))
>     {
>         case KEY_RSA:
>             /* we currently use always SHA1 for signatures,
>              * TODO: support other hashes depending on configuration/auth */
>             scheme = SIGN_RSA_EMSA_PKCS1_SHA1;
>             auth_method = AUTH_RSA;
>             break;

To sign the data for the IKEv2 AUTH payload, charon currently always
uses SHA1. This is independent from the hash used in certificate
signing. SHA1 is the only mandatory algorithm in IKEv2, and there is no
way to negotiate support for specific hash algorithms. Therefore we
currently use SHA1 only.

I've experimented with a configuration option to define the hash
algorithm [1]. It requires major changes to our public key API, so I
haven't completed this work yet.

Alternatively, I'm considering an option to use the same hash algorithm
as used in the certificate used for signing. But this isn't done yet.

Regards
Martin

[1]http://git.strongswan.org/?p=strongswan.git;a=shortlog;h=refs/heads/sig-hash-cfg





More information about the Users mailing list