<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>Hi,</p>
<p><br>
</p>
<p>I'm running strongswan 5.5.1 on Ubuntu 12.04.</p>
<p>We are using IKEv1 and XAuth-Pam . I've posted our ipsec.conf at the bottom of this message.</p>
<p><br>
</p>
<p>We are seeing an issue where after a some amount of time running, </p>
<p>eventually our client starts to see this error every time it tries to connect:</p>
<p><br>
</p>
<p>Dec 19 18:40:52 hostname charon: 15[IKE] signature validation failed, looking for another key</p>
<p>Dec 19 18:40:52 hostname charon: 15[IKE] no trusted RSA public key found for "Cert Subject Removed"</p>
<p><br>
</p>
<p>Now if I restart strongswan, or even try the stroke command 'ipsec rereadall'. Suddenly</p>
<p>connections start working.</p>
<p><br>
</p>
<p>I've rebuilt strongswan with extra logging around where this error occurs and I found</p>
<p>that it is failing inside of this method:</p>
<p><br>
</p>
<p>openssl_rsa_public_key.c method: verify_emsa_pkcs1_signature</p>
<p><br>
</p>
<p>when it tries to call "RSA_public_decrypt". </p>
<p><br>
</p>
<p>I took this even further and dumped the openssl error:</p>
<p><br>
</p>
<p>error:04067072:rsa routines:RSA_EAY_PUBLIC_DECRYPT:padding check failed</p>
<p><br>
</p>
<p>It seems that the server may be returning an invalid signature or public key.</p>
<p>Any ideas on how to handle this. I'm more than willing to add more logging, but I've been unable</p>
<p>to figure out how to get any of the inputs into this method:</p>
<p><br>
</p>
<p> len = RSA_public_decrypt(signature.len, signature.ptr, buf, this->rsa,</p>
<p> RSA_PKCS1_PADDING);</p>
<p><br>
</p>
<p>to dump anything that is human comparable between requests.</p>
<p><br>
</p>
<p><br>
</p>
<p>config setup</p>
<p> charondebug="dmn 1, mgr 1, ike 1, chd 1, job 1, cfg 1, knl 1, net 1, asn 1, enc 1, lib 1, esp 1, tls 1"</p>
<p> #plutodebug=all</p>
<p> # crlcheckinterval=600</p>
<p> strictcrlpolicy=no</p>
<p> # cachecrls=yes</p>
<p> # charondebug=4</p>
<p> nat_traversal=yes</p>
<p> #charonstart=no</p>
<p> #plutostart=no</p>
<p><br>
</p>
<p>ca servers</p>
<p> auto=add</p>
<p><br>
</p>
<p>conn %default</p>
<p> ikelifetime=60m</p>
<p> keylife=20m</p>
<p> rekeymargin=3m</p>
<p> keyingtries=1</p>
<p> keyexchange=ikev1</p>
<p> auto=add</p>
<p><br>
</p>
<p>conn ikev1-xauth-pam</p>
<p> keyexchange=ikev1</p>
<p> rightauth=pubkey</p>
<p> rightauth2=xauth-pam</p>
<p> left=%defaultroute</p>
<p> leftid=@example.com</p>
<p> leftsubnet=0.0.0.0/0</p>
<p> leftfirewall=no</p>
<p> leftcert=example.pem</p>
<p> leftsendcert=always</p>
<p> leftupdown=up_down.sh</p>
<p> right=%any</p>
<p> rightsubnet=10.251.0.0/20</p>
<p> rightsourceip=10.251.0.0/20</p>
<p> # Require all subject fields to be matched by star</p>
<p> # As well as CA's pull in</p>
<p> rightid="C=*, ST=*, L=*, O=*, CN=*, E=*"</p>
<p> fragmentation=yes</p>
<p> auto=add</p>
<p></p>
<p><br>
</p>
<div id="Signature"><br>
<br>
Thank you,<br>
Joshua J. Gross<br>
</div>
</div>
</body>
</html>