Bug: Incorrect IKEv2 Digital Signature by FortiClient 7.4.4/7.4.5
Trying to set up an IKEv2 client-certificate-based IPsec connection from a FortiClient 7.4.4 to a FortiGate VPN Gateway results in the following error in the FortiGate log when evaluating the received IKE_AUTH request:
ike V=root:0:IPSec-Client:176: certificate validation succeeded
ike V=root:0:IPSec-Client:176: signature verification failed
ike V=root:0:IPSec-Client:176: auth verify done
ike V=root:0:IPSec-Client:176: responder AUTH continuation
ike V=root:0:IPSec-Client:176: authentication failed
Parsing the received IKE_AUTH request sent by the FortiClient, we see that the AUTH payload of type Digital Signature (14) defined by RFC 7427 is missing the one octet ASN.1 length field and the following ASN.1 OID of the Algorithm Identifier. Only the raw 64 octet ECDSA 256 Bit Signature has been added:
2F Next Payload: 47 - CP
00 C/Reserved
0048 Length: 72 Octets = 8 + 64 Octets (2*256 Bits)
0E Auth Method: 14 - Digital Signature (RFC 7427)
000000 Reserved
ASN.1 Length: ? (missing)
ASN.1 Algorithm Identifier (OID): ? (missing)
419F71D30B3E1B4D5BFE153186893C1EC589BF954F4CC5A3C679480985D35B22
4715542B4422AA17F7C679BAE4C0ED2334A8C64D64BA6BBC6F333D423B866D93
The same failure when using an 3072 Bit RSA with SHA256 digital signature where only the raw 384 octet signature is present but the preceding ASN.1 OID is missing as well:
2F Next Payload: 47 - CP
00 C/Reserved
0188 Length: 392 Octets = 8 + 384 Octets (3072 Bits)
0E Auth Method: 14 - Digital Signature (RFC 7427)
000000 Reserved
ASN.1 Length: ? (missing)
ASN.1 Algorithm Identifier (OID): ? (missing)
65F376FF7E21AC8B5D6A61FF3B4A61C13A2F7CE12835F2E8579F1FA966D3C66C
4FBA28D07F17AD8E5D0696FAD5095533E4102A5C3A31456D38C59D7E77EFF33C
BBBA12B225FFA14C340149A09ECB7E705719726DAE11CC8FA55F2A522D51BCBB
0EB8FA4DDFFABBB567BF4C822D8F20B45B522985B711374984BC269FDF66E024
60A555237F07FAA444FB39CAB903214E5FB903D7512DBD3CD31FE233D9D92403
CE03B6F8FDEFF965F024AA0A21364CD040B44D2FA3D71240D2EE2B77E0C789AA
0AD4CEFF9BB3CEC690FEAA2FA63A12189A0263E24EB7B633F2406F2CD37E047C
C33AEF9BB3FFC87B81864C9A18059393A5139C49F504F41D0C2D7E94FA61FA06
7BC5AE52282C3C0455686278A342D77FDE1B7A9F24BADB0F5B9FDE7C8AACB25C
7ED68B005E9461C3E5580E295C89D64940C531E968E777DD85182EEFAFB1523C
117EBA9A2F74AC4BD4B7AC8DF27DB5A2163DA3B0AB9513363E69975C858879DA
56F8104EB93F02AEB105020A8506F292390D99F84C561D17D53045BD02B8A551
Is this bug going to be fixed in the next FortiClient release?
