ikev1: Add fragmentation support for Windows peers
I still think ipsec/l2tp with fragmentation support is a useful fallback option in case the Windows IKEv2 connection fails because of fragmentation problems. Tested with Windows XP, 7 and 8.1.
This commit is contained in:
committed by
Tobias Brunner
parent
3633b80147
commit
05db0f97e3
@@ -16,6 +16,28 @@
|
||||
* for more details.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014 Volker Rümelin
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
@@ -1024,6 +1046,14 @@ METHOD(ike_sa_t, generate_message_fragmented, status_t,
|
||||
break;
|
||||
case FRAGMENTATION_YES:
|
||||
use_frags = supports_extension(this, EXT_IKE_FRAGMENTATION);
|
||||
if (use_frags && this->version == IKEV1 &&
|
||||
supports_extension(this, EXT_MS_WINDOWS))
|
||||
{
|
||||
/* It seems Windows 7 and 8 peers only accept proprietary
|
||||
* fragmented messages if they expect certificates. */
|
||||
use_frags = message->get_payload(message,
|
||||
PLV1_CERTIFICATE) != NULL;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user