Revert r338774. Unrelated changes were committed with Apache Serf.
This commit is contained in:
parent
3d32dc633c
commit
3459507c9d
@ -1,26 +1,7 @@
|
|||||||
Apache Serf 1.3.9 [2016-09-01, from tags/1.3.9, rxxxx]
|
Serf 1.3.8 [2014-10-20, from /tags/1.3.8, rxxxx]
|
||||||
serf is now Apache Serf; apply header changes (r1700062)
|
Fix issue #152: CRC calculation error for gzipped http reponses > 4GB.
|
||||||
Fix issue #151: SCons build broken when only one library in ENVPATH
|
Fix issue #153: SSPI CredHandle not freed when APR pool is destroyed.
|
||||||
Fix issue #153: avoid SSPI handle leak
|
Fix issue #154: Disable SSLv2 and SSLv3 as both or broken.
|
||||||
Fix issue #167: Explicitly use the ANSI version of SSPI
|
|
||||||
Fix issue #170: Allow building with Microsoft Visual Studio 2015
|
|
||||||
Fix build of 'check' target when using VPATH-style builds (r1699858, ...)
|
|
||||||
(builddir != srcdir).
|
|
||||||
Resolve a bucket (aka "memory") leak when a request bucket is
|
|
||||||
destroyed before it is morphed into an aggregate bucket (r1699791)
|
|
||||||
Reset state variables when resetting connection (r1708849)
|
|
||||||
Fix types of passed, but unused batons (r1699986, r1699987)
|
|
||||||
Fix some usages of the openssl BIO api (r1699852)
|
|
||||||
Improve handling of bad data in the response state line. (r1699985)
|
|
||||||
Resolve several compiler issues with less common compilers
|
|
||||||
Support more overrides via SCons arguments (r1701836, ...)
|
|
||||||
Adapt to OpenSSL 1.1.x api (r1750819)
|
|
||||||
|
|
||||||
|
|
||||||
Serf 1.3.8 [2014-10-20, from /tags/1.3.8, r2441]
|
|
||||||
Fix issue #152: CRC calculation error for gzipped http reponses > 4GB.
|
|
||||||
Fix issue #153: SSPI CredHandle not freed when APR pool is destroyed.
|
|
||||||
Fix issue #154: Disable SSLv2 and SSLv3 as both or broken.
|
|
||||||
|
|
||||||
|
|
||||||
Serf 1.3.7 [2014-08-11, from /tags/1.3.7, r2411]
|
Serf 1.3.7 [2014-08-11, from /tags/1.3.7, r2411]
|
||||||
|
@ -1,7 +1,2 @@
|
|||||||
Apache Serf
|
This product includes software developed by
|
||||||
Copyright 2015 The Apache Software Foundation
|
The Apache Software Foundation (http://www.apache.org/).
|
||||||
|
|
||||||
This product includes software developed by many people, and distributed
|
|
||||||
under Contributor License Agreements to The Apache Software Foundation
|
|
||||||
(http://www.apache.org/). See the revision logs for an exact contribution
|
|
||||||
history.
|
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
Welcome to Apache Serf, a high-performance asynchronous HTTP client library.
|
Welcome to serf, a high-performance asynchronous HTTP client library.
|
||||||
|
|
||||||
The Apache Serf library is a C-based HTTP client library built upon the Apache
|
The serf library is a C-based HTTP client library built upon the Apache
|
||||||
Portable Runtime (APR) library. It multiplexes connections, running the
|
Portable Runtime (APR) library. It multiplexes connections, running the
|
||||||
read/write communication asynchronously. Memory copies and transformations are
|
read/write communication asynchronously. Memory copies and transformations are
|
||||||
kept to a minimum to provide high performance operation.
|
kept to a minimum to provide high performance operation.
|
||||||
|
|
||||||
* Site: http://serf.apache.org//
|
* Status: http://code.google.com/p/serf/wiki/
|
||||||
* Code: http://svn.apache.org/repos/asf/serf/
|
* Site: http://code.google.com/p/serf/
|
||||||
* Issues: https://issues.apache.org/jira/browse/SERF
|
* Code: http://serf.googlecode.com/svn/
|
||||||
* Mail: dev@serf.apache.org
|
* Issues: http://code.google.com/p/serf/issues/list
|
||||||
|
* Mail: serf-dev@googlegroups.com
|
||||||
* People: Justin Erenkrantz, Greg Stein
|
* People: Justin Erenkrantz, Greg Stein
|
||||||
|
|
||||||
----
|
----
|
||||||
@ -17,8 +18,8 @@ kept to a minimum to provide high performance operation.
|
|||||||
|
|
||||||
1.1. SCons build system
|
1.1. SCons build system
|
||||||
|
|
||||||
Apache Serf uses SCons 2.3 for its build system. If it is not installed
|
serf uses SCons 2.3 for its build system. If it is not installed on
|
||||||
on your system, then you can install it onto your system. If you do not
|
your system, then you can install it onto your system. If you do not
|
||||||
have permissions, then you can download and install the "local"
|
have permissions, then you can download and install the "local"
|
||||||
version into your home directory. When installed privately, simply
|
version into your home directory. When installed privately, simply
|
||||||
create a symlink for 'scons' in your PATH to /path/to/scons/scons.py.
|
create a symlink for 'scons' in your PATH to /path/to/scons/scons.py.
|
||||||
@ -27,7 +28,7 @@ Fetch the scons-local package:
|
|||||||
http://prdownloads.sourceforge.net/scons/scons-local-2.3.0.tar.gz
|
http://prdownloads.sourceforge.net/scons/scons-local-2.3.0.tar.gz
|
||||||
|
|
||||||
|
|
||||||
1.2 Building Apache Serf
|
1.2 Building serf
|
||||||
|
|
||||||
To build serf:
|
To build serf:
|
||||||
|
|
||||||
@ -69,7 +70,7 @@ $ scons --help
|
|||||||
$ scons check
|
$ scons check
|
||||||
|
|
||||||
|
|
||||||
1.4 Installing Apache Serf
|
1.4 Installing serf
|
||||||
|
|
||||||
$ scons install
|
$ scons install
|
||||||
|
|
||||||
|
@ -1,23 +1,18 @@
|
|||||||
# -*- python -*-
|
# -*- python -*-
|
||||||
#
|
#
|
||||||
# ====================================================================
|
# Copyright 2011-2012 Justin Erenkrantz and Greg Stein
|
||||||
# Licensed to the Apache Software Foundation (ASF) under one
|
#
|
||||||
# or more contributor license agreements. See the NOTICE file
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# distributed with this work for additional information
|
# you may not use this file except in compliance with the License.
|
||||||
# regarding copyright ownership. The ASF licenses this file
|
# You may obtain a copy of the License at
|
||||||
# to you under the Apache License, Version 2.0 (the
|
#
|
||||||
# "License"); you may not use this file except in compliance
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
# with the License. You may obtain a copy of the License at
|
#
|
||||||
#
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
#
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# Unless required by applicable law or agreed to in writing,
|
# See the License for the specific language governing permissions and
|
||||||
# software distributed under the License is distributed on an
|
# limitations under the License.
|
||||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
# KIND, either express or implied. See the License for the
|
|
||||||
# specific language governing permissions and limitations
|
|
||||||
# under the License.
|
|
||||||
# ====================================================================
|
|
||||||
#
|
#
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
@ -140,8 +135,7 @@ if sys.platform == 'win32':
|
|||||||
EnumVariable('MSVC_VERSION',
|
EnumVariable('MSVC_VERSION',
|
||||||
"Visual C++ to use for building (E.g. 11.0, 9.0)",
|
"Visual C++ to use for building (E.g. 11.0, 9.0)",
|
||||||
None,
|
None,
|
||||||
allowed_values=('14.0', '12.0',
|
allowed_values=('12.0', '11.0', '10.0', '9.0', '8.0', '6.0')
|
||||||
'11.0', '10.0', '9.0', '8.0', '6.0')
|
|
||||||
),
|
),
|
||||||
|
|
||||||
# We always documented that we handle an install layout, but in fact we
|
# We always documented that we handle an install layout, but in fact we
|
||||||
@ -183,7 +177,8 @@ CALLOUT_OKAY = not (env.GetOption('clean') or env.GetOption('help'))
|
|||||||
|
|
||||||
unknown = opts.UnknownVariables()
|
unknown = opts.UnknownVariables()
|
||||||
if unknown:
|
if unknown:
|
||||||
print 'Warning: Used unknown variables:', ', '.join(unknown.keys())
|
print 'Unknown variables:', ', '.join(unknown.keys())
|
||||||
|
Exit(1)
|
||||||
|
|
||||||
apr = str(env['APR'])
|
apr = str(env['APR'])
|
||||||
apu = str(env['APU'])
|
apu = str(env['APU'])
|
||||||
@ -215,8 +210,7 @@ incdir = '$PREFIX/include/serf-$MAJOR'
|
|||||||
# Unfortunately we can't set the .dylib compatibility_version option separately
|
# Unfortunately we can't set the .dylib compatibility_version option separately
|
||||||
# from current_version, so don't use the PATCH level to avoid that build and
|
# from current_version, so don't use the PATCH level to avoid that build and
|
||||||
# runtime patch levels have to be identical.
|
# runtime patch levels have to be identical.
|
||||||
if sys.platform != 'sunos5':
|
env['SHLIBVERSION'] = '%d.%d.%d' % (MAJOR, MINOR, 0)
|
||||||
env['SHLIBVERSION'] = '%d.%d.%d' % (MAJOR, MINOR, 0)
|
|
||||||
|
|
||||||
LIBNAME = 'libserf-%d' % (MAJOR,)
|
LIBNAME = 'libserf-%d' % (MAJOR,)
|
||||||
if sys.platform != 'win32':
|
if sys.platform != 'win32':
|
||||||
@ -229,43 +223,31 @@ env.Append(RPATH=libdir,
|
|||||||
|
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
# linkflags.append('-Wl,-install_name,@executable_path/%s.dylib' % (LIBNAME,))
|
# linkflags.append('-Wl,-install_name,@executable_path/%s.dylib' % (LIBNAME,))
|
||||||
env.Append(LINKFLAGS=['-Wl,-install_name,%s/%s.dylib' % (thisdir, LIBNAME,)])
|
env.Append(LINKFLAGS='-Wl,-install_name,%s/%s.dylib' % (thisdir, LIBNAME,))
|
||||||
|
|
||||||
if sys.platform != 'win32':
|
if sys.platform != 'win32':
|
||||||
def CheckGnuCC(context):
|
### gcc only. figure out appropriate test / better way to check these
|
||||||
src = '''
|
### flags, and check for gcc.
|
||||||
#ifndef __GNUC__
|
env.Append(CFLAGS='-std=c89')
|
||||||
oh noes!
|
|
||||||
#endif
|
|
||||||
'''
|
|
||||||
context.Message('Checking for GNU-compatible C compiler...')
|
|
||||||
result = context.TryCompile(src, '.c')
|
|
||||||
context.Result(result)
|
|
||||||
return result
|
|
||||||
|
|
||||||
conf = Configure(env, custom_tests = dict(CheckGnuCC=CheckGnuCC))
|
### These warnings are not available on Solaris
|
||||||
have_gcc = conf.CheckGnuCC()
|
if sys.platform != 'sunos5':
|
||||||
env = conf.Finish()
|
|
||||||
|
|
||||||
if have_gcc:
|
|
||||||
env.Append(CFLAGS=['-std=c89'])
|
|
||||||
env.Append(CCFLAGS=['-Wdeclaration-after-statement',
|
env.Append(CCFLAGS=['-Wdeclaration-after-statement',
|
||||||
'-Wmissing-prototypes',
|
'-Wmissing-prototypes',
|
||||||
'-Wall'])
|
'-Wall'])
|
||||||
|
|
||||||
if debug:
|
if debug:
|
||||||
env.Append(CCFLAGS=['-g'])
|
env.Append(CCFLAGS='-g')
|
||||||
env.Append(CPPDEFINES=['DEBUG', '_DEBUG'])
|
env.Append(CPPDEFINES=['DEBUG', '_DEBUG'])
|
||||||
else:
|
else:
|
||||||
env.Append(CCFLAGS=['-O2'])
|
env.Append(CCFLAGS='-O2')
|
||||||
env.Append(CPPDEFINES=['NDEBUG'])
|
env.Append(CPPDEFINES='NDEBUG')
|
||||||
|
|
||||||
### works for Mac OS. probably needs to change
|
### works for Mac OS. probably needs to change
|
||||||
env.Append(LIBS=['ssl', 'crypto', 'z', ])
|
env.Append(LIBS=['ssl', 'crypto', 'z', ])
|
||||||
|
|
||||||
if sys.platform == 'sunos5':
|
if sys.platform == 'sunos5':
|
||||||
env.Append(LIBS=['m'])
|
env.Append(LIBS='m')
|
||||||
env.Append(PLATFORM='posix')
|
|
||||||
else:
|
else:
|
||||||
# Warning level 4, no unused argument warnings
|
# Warning level 4, no unused argument warnings
|
||||||
env.Append(CCFLAGS=['/W4', '/wd4100'])
|
env.Append(CCFLAGS=['/W4', '/wd4100'])
|
||||||
@ -278,8 +260,8 @@ else:
|
|||||||
else:
|
else:
|
||||||
# Optimize for speed, use DLL runtime
|
# Optimize for speed, use DLL runtime
|
||||||
env.Append(CCFLAGS=['/O2', '/MD'])
|
env.Append(CCFLAGS=['/O2', '/MD'])
|
||||||
env.Append(CPPDEFINES=['NDEBUG'])
|
env.Append(CPPDEFINES='NDEBUG')
|
||||||
env.Append(LINKFLAGS=['/RELEASE'])
|
env.Append(LINKFLAGS='/RELEASE')
|
||||||
|
|
||||||
# PLAN THE BUILD
|
# PLAN THE BUILD
|
||||||
SHARED_SOURCES = []
|
SHARED_SOURCES = []
|
||||||
@ -309,7 +291,6 @@ if sys.platform == 'win32':
|
|||||||
if aprstatic:
|
if aprstatic:
|
||||||
apr_libs='apr-1.lib'
|
apr_libs='apr-1.lib'
|
||||||
apu_libs='aprutil-1.lib'
|
apu_libs='aprutil-1.lib'
|
||||||
env.Append(LIBS=['shell32.lib', 'xml.lib'])
|
|
||||||
else:
|
else:
|
||||||
apr_libs='libapr-1.lib'
|
apr_libs='libapr-1.lib'
|
||||||
apu_libs='libaprutil-1.lib'
|
apu_libs='libaprutil-1.lib'
|
||||||
@ -326,25 +307,25 @@ if sys.platform == 'win32':
|
|||||||
CPPPATH=['$APR/include', '$APU/include'])
|
CPPPATH=['$APR/include', '$APU/include'])
|
||||||
|
|
||||||
# zlib
|
# zlib
|
||||||
env.Append(LIBS=['zlib.lib'])
|
env.Append(LIBS='zlib.lib')
|
||||||
if not env.get('SOURCE_LAYOUT', None):
|
if not env.get('SOURCE_LAYOUT', None):
|
||||||
env.Append(CPPPATH=['$ZLIB/include'],
|
env.Append(CPPPATH='$ZLIB/include',
|
||||||
LIBPATH=['$ZLIB/lib'])
|
LIBPATH='$ZLIB/lib')
|
||||||
else:
|
else:
|
||||||
env.Append(CPPPATH=['$ZLIB'],
|
env.Append(CPPPATH='$ZLIB',
|
||||||
LIBPATH=['$ZLIB'])
|
LIBPATH='$ZLIB')
|
||||||
|
|
||||||
# openssl
|
# openssl
|
||||||
env.Append(LIBS=['libeay32.lib', 'ssleay32.lib'])
|
env.Append(LIBS=['libeay32.lib', 'ssleay32.lib'])
|
||||||
if not env.get('SOURCE_LAYOUT', None):
|
if not env.get('SOURCE_LAYOUT', None):
|
||||||
env.Append(CPPPATH=['$OPENSSL/include/openssl'],
|
env.Append(CPPPATH='$OPENSSL/include/openssl',
|
||||||
LIBPATH=['$OPENSSL/lib'])
|
LIBPATH='$OPENSSL/lib')
|
||||||
elif 0: # opensslstatic:
|
elif 0: # opensslstatic:
|
||||||
env.Append(CPPPATH=['$OPENSSL/inc32'],
|
env.Append(CPPPATH='$OPENSSL/inc32',
|
||||||
LIBPATH=['$OPENSSL/out32'])
|
LIBPATH='$OPENSSL/out32')
|
||||||
else:
|
else:
|
||||||
env.Append(CPPPATH=['$OPENSSL/inc32'],
|
env.Append(CPPPATH='$OPENSSL/inc32',
|
||||||
LIBPATH=['$OPENSSL/out32dll'])
|
LIBPATH='$OPENSSL/out32dll')
|
||||||
else:
|
else:
|
||||||
if os.path.isdir(apr):
|
if os.path.isdir(apr):
|
||||||
apr = os.path.join(apr, 'bin', 'apr-1-config')
|
apr = os.path.join(apr, 'bin', 'apr-1-config')
|
||||||
@ -370,8 +351,8 @@ else:
|
|||||||
apr_libs = ''
|
apr_libs = ''
|
||||||
apu_libs = ''
|
apu_libs = ''
|
||||||
|
|
||||||
env.Append(CPPPATH=['$OPENSSL/include'])
|
env.Append(CPPPATH='$OPENSSL/include')
|
||||||
env.Append(LIBPATH=['$OPENSSL/lib'])
|
env.Append(LIBPATH='$OPENSSL/lib')
|
||||||
|
|
||||||
|
|
||||||
# If build with gssapi, get its information and define SERF_HAVE_GSSAPI
|
# If build with gssapi, get its information and define SERF_HAVE_GSSAPI
|
||||||
@ -381,7 +362,7 @@ if gssapi and CALLOUT_OKAY:
|
|||||||
env['GSSAPI_LIBS'] = cmd.strip()
|
env['GSSAPI_LIBS'] = cmd.strip()
|
||||||
return env.MergeFlags(cmd, unique)
|
return env.MergeFlags(cmd, unique)
|
||||||
env.ParseConfig('$GSSAPI --libs gssapi', parse_libs)
|
env.ParseConfig('$GSSAPI --libs gssapi', parse_libs)
|
||||||
env.Append(CPPDEFINES=['SERF_HAVE_GSSAPI'])
|
env.Append(CPPDEFINES='SERF_HAVE_GSSAPI')
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
env.Append(CPPDEFINES=['SERF_HAVE_SSPI'])
|
env.Append(CPPDEFINES=['SERF_HAVE_SSPI'])
|
||||||
|
|
||||||
@ -447,12 +428,6 @@ env.Alias('install', ['install-lib', 'install-inc', 'install-pc', ])
|
|||||||
|
|
||||||
tenv = env.Clone()
|
tenv = env.Clone()
|
||||||
|
|
||||||
# MockHTTP requires C99 standard, so use it for the test suite.
|
|
||||||
cflags = tenv['CFLAGS']
|
|
||||||
tenv.Replace(CFLAGS = [f.replace('-std=c89', '-std=c99') for f in cflags])
|
|
||||||
|
|
||||||
tenv.Append(CPPDEFINES=['MOCKHTTP_OPENSSL'])
|
|
||||||
|
|
||||||
TEST_PROGRAMS = [ 'serf_get', 'serf_response', 'serf_request', 'serf_spider',
|
TEST_PROGRAMS = [ 'serf_get', 'serf_response', 'serf_request', 'serf_spider',
|
||||||
'test_all', 'serf_bwtp' ]
|
'test_all', 'serf_bwtp' ]
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
@ -460,23 +435,14 @@ if sys.platform == 'win32':
|
|||||||
else:
|
else:
|
||||||
TEST_EXES = [ os.path.join('test', '%s' % (prog)) for prog in TEST_PROGRAMS ]
|
TEST_EXES = [ os.path.join('test', '%s' % (prog)) for prog in TEST_PROGRAMS ]
|
||||||
|
|
||||||
|
env.AlwaysBuild(env.Alias('check', TEST_EXES, sys.executable + ' build/check.py',
|
||||||
|
ENV={'PATH' : os.environ['PATH']}))
|
||||||
|
|
||||||
# Find the (dynamic) library in this directory
|
# Find the (dynamic) library in this directory
|
||||||
tenv.Replace(RPATH=thisdir)
|
tenv.Replace(RPATH=thisdir)
|
||||||
tenv.Prepend(LIBS=[LIBNAMESTATIC, ],
|
tenv.Prepend(LIBS=[LIBNAMESTATIC, ],
|
||||||
LIBPATH=[thisdir, ])
|
LIBPATH=[thisdir, ])
|
||||||
|
|
||||||
check_script = env.File('build/check.py').rstr()
|
|
||||||
test_dir = env.File('test/test_all.c').rfile().get_dir()
|
|
||||||
src_dir = env.File('serf.h').rfile().get_dir()
|
|
||||||
test_app = ("%s %s %s %s") % (sys.executable, check_script, test_dir, 'test')
|
|
||||||
|
|
||||||
# Set the library search path for the test programs
|
|
||||||
test_env = {'PATH' : os.environ['PATH'],
|
|
||||||
'srcdir' : src_dir}
|
|
||||||
if sys.platform != 'win32':
|
|
||||||
test_env['LD_LIBRARY_PATH'] = ':'.join(tenv.get('LIBPATH', []))
|
|
||||||
env.AlwaysBuild(env.Alias('check', TEST_EXES, test_app, ENV=test_env))
|
|
||||||
|
|
||||||
testall_files = [
|
testall_files = [
|
||||||
'test/test_all.c',
|
'test/test_all.c',
|
||||||
'test/CuTest.c',
|
'test/CuTest.c',
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2009 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "serf.h"
|
#include "serf.h"
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2009 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef AUTH_H
|
#ifndef AUTH_H
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2009 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*** Basic authentication ***/
|
/*** Basic authentication ***/
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2009 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*** Digest authentication ***/
|
/*** Digest authentication ***/
|
||||||
|
@ -1,24 +1,18 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2009 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "auth_spnego.h"
|
#include "auth_spnego.h"
|
||||||
|
|
||||||
#ifdef SERF_HAVE_SPNEGO
|
#ifdef SERF_HAVE_SPNEGO
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2010 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef AUTH_SPNEGO_H
|
#ifndef AUTH_SPNEGO_H
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2009 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "serf.h"
|
#include "serf.h"
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2010 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "auth_spnego.h"
|
#include "auth_spnego.h"
|
||||||
@ -143,7 +138,7 @@ serf__spnego_create_sec_context(serf__spnego_context_t **ctx_p,
|
|||||||
else
|
else
|
||||||
sspi_package = "NTLM";
|
sspi_package = "NTLM";
|
||||||
|
|
||||||
sspi_status = AcquireCredentialsHandleA(
|
sspi_status = AcquireCredentialsHandle(
|
||||||
NULL, sspi_package, SECPKG_CRED_OUTBOUND,
|
NULL, sspi_package, SECPKG_CRED_OUTBOUND,
|
||||||
NULL, NULL, NULL, NULL,
|
NULL, NULL, NULL, NULL,
|
||||||
&ctx->sspi_credentials, NULL);
|
&ctx->sspi_credentials, NULL);
|
||||||
@ -252,7 +247,7 @@ serf__spnego_init_sec_context(serf_connection_t *conn,
|
|||||||
sspi_out_buffer_desc.pBuffers = &sspi_out_buffer;
|
sspi_out_buffer_desc.pBuffers = &sspi_out_buffer;
|
||||||
sspi_out_buffer_desc.ulVersion = SECBUFFER_VERSION;
|
sspi_out_buffer_desc.ulVersion = SECBUFFER_VERSION;
|
||||||
|
|
||||||
status = InitializeSecurityContextA(
|
status = InitializeSecurityContext(
|
||||||
&ctx->sspi_credentials,
|
&ctx->sspi_credentials,
|
||||||
ctx->initalized ? &ctx->sspi_context : NULL,
|
ctx->initalized ? &ctx->sspi_context : NULL,
|
||||||
ctx->target_name,
|
ctx->target_name,
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "serf.h"
|
#include "serf.h"
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <apr_pools.h>
|
#include <apr_pools.h>
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <apr_pools.h>
|
#include <apr_pools.h>
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <apr_pools.h>
|
#include <apr_pools.h>
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <apr_pools.h>
|
#include <apr_pools.h>
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <apr_strings.h>
|
#include <apr_strings.h>
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <apr_strings.h>
|
#include <apr_strings.h>
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <apr_pools.h>
|
#include <apr_pools.h>
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2011 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <apr_pools.h>
|
#include <apr_pools.h>
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <apr_pools.h>
|
#include <apr_pools.h>
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <apr_pools.h>
|
#include <apr_pools.h>
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <apr_pools.h>
|
#include <apr_pools.h>
|
||||||
@ -195,20 +190,6 @@ static apr_status_t serf_request_peek(serf_bucket_t *bucket,
|
|||||||
return serf_bucket_peek(bucket, data, len);
|
return serf_bucket_peek(bucket, data, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Note that this function is only called when serialize_data()
|
|
||||||
hasn't been called on the bucket */
|
|
||||||
static void serf_request_destroy(serf_bucket_t *bucket)
|
|
||||||
{
|
|
||||||
request_context_t *ctx = bucket->data;
|
|
||||||
|
|
||||||
serf_bucket_destroy(ctx->headers);
|
|
||||||
|
|
||||||
if (ctx->body)
|
|
||||||
serf_bucket_destroy(ctx->body);
|
|
||||||
|
|
||||||
serf_default_destroy_and_data(bucket);
|
|
||||||
}
|
|
||||||
|
|
||||||
void serf_bucket_request_become(
|
void serf_bucket_request_become(
|
||||||
serf_bucket_t *bucket,
|
serf_bucket_t *bucket,
|
||||||
const char *method,
|
const char *method,
|
||||||
@ -237,6 +218,6 @@ const serf_bucket_type_t serf_bucket_type_request = {
|
|||||||
serf_default_read_for_sendfile,
|
serf_default_read_for_sendfile,
|
||||||
serf_default_read_bucket,
|
serf_default_read_bucket,
|
||||||
serf_request_peek,
|
serf_request_peek,
|
||||||
serf_request_destroy,
|
serf_default_destroy_and_data,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <apr_pools.h>
|
#include <apr_pools.h>
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <apr_lib.h>
|
#include <apr_lib.h>
|
||||||
@ -133,17 +128,7 @@ static apr_status_t parse_status_line(response_context_t *ctx,
|
|||||||
int res;
|
int res;
|
||||||
char *reason; /* ### stupid APR interface makes this non-const */
|
char *reason; /* ### stupid APR interface makes this non-const */
|
||||||
|
|
||||||
/* Ensure a valid length, to avoid overflow on the final '\0' */
|
/* ctx->linebuf.line should be of form: HTTP/1.1 200 OK */
|
||||||
if (ctx->linebuf.used >= SERF_LINEBUF_LIMIT) {
|
|
||||||
return SERF_ERROR_BAD_HTTP_RESPONSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* apr_date_checkmask assumes its arguments are valid C strings */
|
|
||||||
ctx->linebuf.line[ctx->linebuf.used] = '\0';
|
|
||||||
|
|
||||||
/* ctx->linebuf.line should be of form: 'HTTP/1.1 200 OK',
|
|
||||||
but we also explicitly allow the forms 'HTTP/1.1 200' (no reason)
|
|
||||||
and 'HTTP/1.1 401.1 Logon failed' (iis extended error codes) */
|
|
||||||
res = apr_date_checkmask(ctx->linebuf.line, "HTTP/#.# ###*");
|
res = apr_date_checkmask(ctx->linebuf.line, "HTTP/#.# ###*");
|
||||||
if (!res) {
|
if (!res) {
|
||||||
/* Not an HTTP response? Well, at least we won't understand it. */
|
/* Not an HTTP response? Well, at least we won't understand it. */
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <apr_pools.h>
|
#include <apr_pools.h>
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <apr_pools.h>
|
#include <apr_pools.h>
|
||||||
|
@ -1,24 +1,36 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*
|
*
|
||||||
* ----
|
* ----
|
||||||
*
|
*
|
||||||
|
* For the OpenSSL thread-safety locking code:
|
||||||
|
*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright ownership.
|
||||||
|
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
* (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
* Originally developed by Aaron Bannert and Justin Erenkrantz, eBuilt.
|
* Originally developed by Aaron Bannert and Justin Erenkrantz, eBuilt.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -52,10 +64,6 @@
|
|||||||
#define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push(ary)))
|
#define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push(ary)))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
|
|
||||||
#define USE_OPENSSL_1_1_API
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Here's an overview of the SSL bucket's relationship to OpenSSL and serf.
|
* Here's an overview of the SSL bucket's relationship to OpenSSL and serf.
|
||||||
@ -144,7 +152,6 @@ struct serf_ssl_context_t {
|
|||||||
SSL_CTX *ctx;
|
SSL_CTX *ctx;
|
||||||
SSL *ssl;
|
SSL *ssl;
|
||||||
BIO *bio;
|
BIO *bio;
|
||||||
BIO_METHOD *biom;
|
|
||||||
|
|
||||||
serf_ssl_stream_t encrypt;
|
serf_ssl_stream_t encrypt;
|
||||||
serf_ssl_stream_t decrypt;
|
serf_ssl_stream_t decrypt;
|
||||||
@ -237,28 +244,10 @@ apps_ssl_info_callback(const SSL *s, int where, int ret)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void bio_set_data(BIO *bio, void *data)
|
|
||||||
{
|
|
||||||
#ifdef USE_OPENSSL_1_1_API
|
|
||||||
BIO_set_data(bio, data);
|
|
||||||
#else
|
|
||||||
bio->ptr = data;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static void *bio_get_data(BIO *bio)
|
|
||||||
{
|
|
||||||
#ifdef USE_OPENSSL_1_1_API
|
|
||||||
return BIO_get_data(bio);
|
|
||||||
#else
|
|
||||||
return bio->ptr;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Returns the amount read. */
|
/* Returns the amount read. */
|
||||||
static int bio_bucket_read(BIO *bio, char *in, int inlen)
|
static int bio_bucket_read(BIO *bio, char *in, int inlen)
|
||||||
{
|
{
|
||||||
serf_ssl_context_t *ctx = bio_get_data(bio);
|
serf_ssl_context_t *ctx = bio->ptr;
|
||||||
const char *data;
|
const char *data;
|
||||||
apr_status_t status;
|
apr_status_t status;
|
||||||
apr_size_t len;
|
apr_size_t len;
|
||||||
@ -302,7 +291,7 @@ static int bio_bucket_read(BIO *bio, char *in, int inlen)
|
|||||||
/* Returns the amount written. */
|
/* Returns the amount written. */
|
||||||
static int bio_bucket_write(BIO *bio, const char *in, int inl)
|
static int bio_bucket_write(BIO *bio, const char *in, int inl)
|
||||||
{
|
{
|
||||||
serf_ssl_context_t *ctx = bio_get_data(bio);
|
serf_ssl_context_t *ctx = bio->ptr;
|
||||||
serf_bucket_t *tmp;
|
serf_bucket_t *tmp;
|
||||||
|
|
||||||
serf__log(SSL_VERBOSE, __FILE__, "bio_bucket_write called for %d bytes\n",
|
serf__log(SSL_VERBOSE, __FILE__, "bio_bucket_write called for %d bytes\n",
|
||||||
@ -330,16 +319,19 @@ static int bio_bucket_write(BIO *bio, const char *in, int inl)
|
|||||||
/* Returns the amount read. */
|
/* Returns the amount read. */
|
||||||
static int bio_file_read(BIO *bio, char *in, int inlen)
|
static int bio_file_read(BIO *bio, char *in, int inlen)
|
||||||
{
|
{
|
||||||
apr_file_t *file = bio_get_data(bio);
|
apr_file_t *file = bio->ptr;
|
||||||
apr_status_t status;
|
apr_status_t status;
|
||||||
apr_size_t len;
|
apr_size_t len;
|
||||||
|
|
||||||
|
BIO_clear_retry_flags(bio);
|
||||||
|
|
||||||
len = inlen;
|
len = inlen;
|
||||||
status = apr_file_read(file, in, &len);
|
status = apr_file_read(file, in, &len);
|
||||||
|
|
||||||
if (!SERF_BUCKET_READ_ERROR(status)) {
|
if (!SERF_BUCKET_READ_ERROR(status)) {
|
||||||
/* Oh suck. */
|
/* Oh suck. */
|
||||||
if (APR_STATUS_IS_EOF(status)) {
|
if (APR_STATUS_IS_EOF(status)) {
|
||||||
|
BIO_set_retry_read(bio);
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
return len;
|
return len;
|
||||||
@ -352,7 +344,7 @@ static int bio_file_read(BIO *bio, char *in, int inlen)
|
|||||||
/* Returns the amount written. */
|
/* Returns the amount written. */
|
||||||
static int bio_file_write(BIO *bio, const char *in, int inl)
|
static int bio_file_write(BIO *bio, const char *in, int inl)
|
||||||
{
|
{
|
||||||
apr_file_t *file = bio_get_data(bio);
|
apr_file_t *file = bio->ptr;
|
||||||
apr_size_t nbytes;
|
apr_size_t nbytes;
|
||||||
|
|
||||||
BIO_clear_retry_flags(bio);
|
BIO_clear_retry_flags(bio);
|
||||||
@ -365,32 +357,15 @@ static int bio_file_write(BIO *bio, const char *in, int inl)
|
|||||||
|
|
||||||
static int bio_file_gets(BIO *bio, char *in, int inlen)
|
static int bio_file_gets(BIO *bio, char *in, int inlen)
|
||||||
{
|
{
|
||||||
apr_file_t *file = bio_get_data(bio);
|
return bio_file_read(bio, in, inlen);
|
||||||
apr_status_t status;
|
|
||||||
|
|
||||||
status = apr_file_gets(in, inlen, file);
|
|
||||||
|
|
||||||
if (! status) {
|
|
||||||
return (int)strlen(in);
|
|
||||||
} else if (APR_STATUS_IS_EOF(status)) {
|
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
return -1; /* Signal generic error */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int bio_bucket_create(BIO *bio)
|
static int bio_bucket_create(BIO *bio)
|
||||||
{
|
{
|
||||||
#ifdef USE_OPENSSL_1_1_API
|
|
||||||
BIO_set_shutdown(bio, 1);
|
|
||||||
BIO_set_init(bio, 1);
|
|
||||||
BIO_set_data(bio, NULL);
|
|
||||||
#else
|
|
||||||
bio->shutdown = 1;
|
bio->shutdown = 1;
|
||||||
bio->init = 1;
|
bio->init = 1;
|
||||||
bio->num = -1;
|
bio->num = -1;
|
||||||
bio->ptr = NULL;
|
bio->ptr = NULL;
|
||||||
#endif
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -424,7 +399,6 @@ static long bio_bucket_ctrl(BIO *bio, int cmd, long num, void *ptr)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef USE_OPENSSL_1_1_API
|
|
||||||
static BIO_METHOD bio_bucket_method = {
|
static BIO_METHOD bio_bucket_method = {
|
||||||
BIO_TYPE_MEM,
|
BIO_TYPE_MEM,
|
||||||
"Serf SSL encryption and decryption buckets",
|
"Serf SSL encryption and decryption buckets",
|
||||||
@ -454,55 +428,6 @@ static BIO_METHOD bio_file_method = {
|
|||||||
NULL /* sslc does not have the callback_ctrl field */
|
NULL /* sslc does not have the callback_ctrl field */
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
static BIO_METHOD *bio_meth_bucket_new(void)
|
|
||||||
{
|
|
||||||
BIO_METHOD *biom = NULL;
|
|
||||||
|
|
||||||
#ifdef USE_OPENSSL_1_1_API
|
|
||||||
biom = BIO_meth_new(BIO_TYPE_MEM,
|
|
||||||
"Serf SSL encryption and decryption buckets");
|
|
||||||
if (biom) {
|
|
||||||
BIO_meth_set_write(biom, bio_bucket_write);
|
|
||||||
BIO_meth_set_read(biom, bio_bucket_read);
|
|
||||||
BIO_meth_set_ctrl(biom, bio_bucket_ctrl);
|
|
||||||
BIO_meth_set_create(biom, bio_bucket_create);
|
|
||||||
BIO_meth_set_destroy(biom, bio_bucket_destroy);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
biom = &bio_bucket_method;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return biom;
|
|
||||||
}
|
|
||||||
|
|
||||||
static BIO_METHOD *bio_meth_file_new(void)
|
|
||||||
{
|
|
||||||
BIO_METHOD *biom = NULL;
|
|
||||||
|
|
||||||
#ifdef USE_OPENSSL_1_1_API
|
|
||||||
biom = BIO_meth_new(BIO_TYPE_FILE,
|
|
||||||
"Wrapper around APR file structures");
|
|
||||||
BIO_meth_set_write(biom, bio_file_write);
|
|
||||||
BIO_meth_set_read(biom, bio_file_read);
|
|
||||||
BIO_meth_set_gets(biom, bio_file_gets);
|
|
||||||
BIO_meth_set_ctrl(biom, bio_bucket_ctrl);
|
|
||||||
BIO_meth_set_create(biom, bio_bucket_create);
|
|
||||||
BIO_meth_set_destroy(biom, bio_bucket_destroy);
|
|
||||||
#else
|
|
||||||
biom = &bio_file_method;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return biom;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void bio_meth_free(BIO_METHOD *biom)
|
|
||||||
{
|
|
||||||
#ifdef USE_OPENSSL_1_1_API
|
|
||||||
BIO_meth_free(biom);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef enum san_copy_t {
|
typedef enum san_copy_t {
|
||||||
EscapeNulAndCopy = 0,
|
EscapeNulAndCopy = 0,
|
||||||
@ -1052,7 +977,7 @@ static apr_status_t ssl_encrypt(void *baton, apr_size_t bufsize,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if APR_HAS_THREADS && !defined(USE_OPENSSL_1_1_API)
|
#if APR_HAS_THREADS
|
||||||
static apr_pool_t *ssl_pool;
|
static apr_pool_t *ssl_pool;
|
||||||
static apr_thread_mutex_t **ssl_locks;
|
static apr_thread_mutex_t **ssl_locks;
|
||||||
|
|
||||||
@ -1139,7 +1064,7 @@ static void init_ssl_libraries(void)
|
|||||||
val = apr_atomic_cas32(&have_init_ssl, INIT_BUSY, INIT_UNINITIALIZED);
|
val = apr_atomic_cas32(&have_init_ssl, INIT_BUSY, INIT_UNINITIALIZED);
|
||||||
|
|
||||||
if (!val) {
|
if (!val) {
|
||||||
#if APR_HAS_THREADS && !defined(USE_OPENSSL_1_1_API)
|
#if APR_HAS_THREADS
|
||||||
int i, numlocks;
|
int i, numlocks;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1156,17 +1081,13 @@ static void init_ssl_libraries(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_OPENSSL_1_1_API
|
|
||||||
OPENSSL_malloc_init();
|
|
||||||
#else
|
|
||||||
CRYPTO_malloc_init();
|
CRYPTO_malloc_init();
|
||||||
#endif
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
SSL_load_error_strings();
|
SSL_load_error_strings();
|
||||||
SSL_library_init();
|
SSL_library_init();
|
||||||
OpenSSL_add_all_algorithms();
|
OpenSSL_add_all_algorithms();
|
||||||
|
|
||||||
#if APR_HAS_THREADS && !defined(USE_OPENSSL_1_1_API)
|
#if APR_HAS_THREADS
|
||||||
numlocks = CRYPTO_num_locks();
|
numlocks = CRYPTO_num_locks();
|
||||||
apr_pool_create(&ssl_pool, NULL);
|
apr_pool_create(&ssl_pool, NULL);
|
||||||
ssl_locks = apr_palloc(ssl_pool, sizeof(apr_thread_mutex_t*)*numlocks);
|
ssl_locks = apr_palloc(ssl_pool, sizeof(apr_thread_mutex_t*)*numlocks);
|
||||||
@ -1219,7 +1140,6 @@ static int ssl_need_client_cert(SSL *ssl, X509 **cert, EVP_PKEY **pkey)
|
|||||||
const char *cert_path;
|
const char *cert_path;
|
||||||
apr_file_t *cert_file;
|
apr_file_t *cert_file;
|
||||||
BIO *bio;
|
BIO *bio;
|
||||||
BIO_METHOD *biom;
|
|
||||||
PKCS12 *p12;
|
PKCS12 *p12;
|
||||||
int i;
|
int i;
|
||||||
int retrying_success = 0;
|
int retrying_success = 0;
|
||||||
@ -1245,9 +1165,8 @@ static int ssl_need_client_cert(SSL *ssl, X509 **cert, EVP_PKEY **pkey)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
biom = bio_meth_file_new();
|
bio = BIO_new(&bio_file_method);
|
||||||
bio = BIO_new(biom);
|
bio->ptr = cert_file;
|
||||||
bio_set_data(bio, cert_file);
|
|
||||||
|
|
||||||
ctx->cert_path = cert_path;
|
ctx->cert_path = cert_path;
|
||||||
p12 = d2i_PKCS12_bio(bio, NULL);
|
p12 = d2i_PKCS12_bio(bio, NULL);
|
||||||
@ -1257,7 +1176,6 @@ static int ssl_need_client_cert(SSL *ssl, X509 **cert, EVP_PKEY **pkey)
|
|||||||
|
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
PKCS12_free(p12);
|
PKCS12_free(p12);
|
||||||
bio_meth_free(biom);
|
|
||||||
ctx->cached_cert = *cert;
|
ctx->cached_cert = *cert;
|
||||||
ctx->cached_cert_pw = *pkey;
|
ctx->cached_cert_pw = *pkey;
|
||||||
if (!retrying_success && ctx->cert_cache_pool) {
|
if (!retrying_success && ctx->cert_cache_pool) {
|
||||||
@ -1293,7 +1211,6 @@ static int ssl_need_client_cert(SSL *ssl, X509 **cert, EVP_PKEY **pkey)
|
|||||||
i = PKCS12_parse(p12, password, pkey, cert, NULL);
|
i = PKCS12_parse(p12, password, pkey, cert, NULL);
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
PKCS12_free(p12);
|
PKCS12_free(p12);
|
||||||
bio_meth_free(biom);
|
|
||||||
ctx->cached_cert = *cert;
|
ctx->cached_cert = *cert;
|
||||||
ctx->cached_cert_pw = *pkey;
|
ctx->cached_cert_pw = *pkey;
|
||||||
if (!retrying_success && ctx->cert_cache_pool) {
|
if (!retrying_success && ctx->cert_cache_pool) {
|
||||||
@ -1321,7 +1238,6 @@ static int ssl_need_client_cert(SSL *ssl, X509 **cert, EVP_PKEY **pkey)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
PKCS12_free(p12);
|
PKCS12_free(p12);
|
||||||
bio_meth_free(biom);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1329,7 +1245,6 @@ static int ssl_need_client_cert(SSL *ssl, X509 **cert, EVP_PKEY **pkey)
|
|||||||
ERR_GET_FUNC(err),
|
ERR_GET_FUNC(err),
|
||||||
ERR_GET_REASON(err));
|
ERR_GET_REASON(err));
|
||||||
PKCS12_free(p12);
|
PKCS12_free(p12);
|
||||||
bio_meth_free(biom);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1424,9 +1339,8 @@ static serf_ssl_context_t *ssl_init_context(serf_bucket_alloc_t *allocator)
|
|||||||
disable_compression(ssl_ctx);
|
disable_compression(ssl_ctx);
|
||||||
|
|
||||||
ssl_ctx->ssl = SSL_new(ssl_ctx->ctx);
|
ssl_ctx->ssl = SSL_new(ssl_ctx->ctx);
|
||||||
ssl_ctx->biom = bio_meth_bucket_new();
|
ssl_ctx->bio = BIO_new(&bio_bucket_method);
|
||||||
ssl_ctx->bio = BIO_new(ssl_ctx->biom);
|
ssl_ctx->bio->ptr = ssl_ctx;
|
||||||
bio_set_data(ssl_ctx->bio, ssl_ctx);
|
|
||||||
|
|
||||||
SSL_set_bio(ssl_ctx->ssl, ssl_ctx->bio, ssl_ctx->bio);
|
SSL_set_bio(ssl_ctx->ssl, ssl_ctx->bio, ssl_ctx->bio);
|
||||||
|
|
||||||
@ -1469,7 +1383,6 @@ static apr_status_t ssl_free_context(
|
|||||||
|
|
||||||
/* SSL_free implicitly frees the underlying BIO. */
|
/* SSL_free implicitly frees the underlying BIO. */
|
||||||
SSL_free(ssl_ctx->ssl);
|
SSL_free(ssl_ctx->ssl);
|
||||||
bio_meth_free(ssl_ctx->biom);
|
|
||||||
SSL_CTX_free(ssl_ctx->ctx);
|
SSL_CTX_free(ssl_ctx->ctx);
|
||||||
|
|
||||||
serf_bucket_mem_free(ssl_ctx->allocator, ssl_ctx);
|
serf_bucket_mem_free(ssl_ctx->allocator, ssl_ctx);
|
||||||
|
@ -2,25 +2,21 @@
|
|||||||
#
|
#
|
||||||
# check.py : Run all the test cases.
|
# check.py : Run all the test cases.
|
||||||
#
|
#
|
||||||
# ===================================================================
|
# ====================================================================
|
||||||
# Licensed to the Apache Software Foundation (ASF) under one
|
# Copyright 2013 Justin Erenkrantz and Greg Stein
|
||||||
# or more contributor license agreements. See the NOTICE file
|
|
||||||
# distributed with this work for additional information
|
|
||||||
# regarding copyright ownership. The ASF licenses this file
|
|
||||||
# to you under the Apache License, Version 2.0 (the
|
|
||||||
# "License"); you may not use this file except in compliance
|
|
||||||
# with the License. You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing,
|
|
||||||
# software distributed under the License is distributed on an
|
|
||||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
# KIND, either express or implied. See the License for the
|
|
||||||
# specific language governing permissions and limitations
|
|
||||||
# under the License.
|
|
||||||
# ===================================================================
|
|
||||||
#
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
# ====================================================================
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import glob
|
import glob
|
||||||
@ -35,11 +31,6 @@ if __name__ == '__main__':
|
|||||||
else:
|
else:
|
||||||
testdir = 'test'
|
testdir = 'test'
|
||||||
|
|
||||||
if len(sys.argv) > 2:
|
|
||||||
test_builddir = sys.argv[2]
|
|
||||||
else:
|
|
||||||
test_builddir = 'test'
|
|
||||||
|
|
||||||
# define test executable paths
|
# define test executable paths
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
SERF_RESPONSE_EXE = 'serf_response.exe'
|
SERF_RESPONSE_EXE = 'serf_response.exe'
|
||||||
@ -47,8 +38,8 @@ if __name__ == '__main__':
|
|||||||
else:
|
else:
|
||||||
SERF_RESPONSE_EXE = 'serf_response'
|
SERF_RESPONSE_EXE = 'serf_response'
|
||||||
TEST_ALL_EXE = 'test_all'
|
TEST_ALL_EXE = 'test_all'
|
||||||
SERF_RESPONSE_EXE = os.path.join(test_builddir, SERF_RESPONSE_EXE)
|
SERF_RESPONSE_EXE = os.path.join(testdir, SERF_RESPONSE_EXE)
|
||||||
TEST_ALL_EXE = os.path.join(test_builddir, TEST_ALL_EXE)
|
TEST_ALL_EXE = os.path.join(testdir, TEST_ALL_EXE)
|
||||||
|
|
||||||
# Find test responses and run them one by one
|
# Find test responses and run them one by one
|
||||||
for case in glob.glob(testdir + "/testcases/*.response"):
|
for case in glob.glob(testdir + "/testcases/*.response"):
|
||||||
|
@ -2,24 +2,22 @@
|
|||||||
#
|
#
|
||||||
# gen_def.py : Generate the .DEF file for Windows builds
|
# gen_def.py : Generate the .DEF file for Windows builds
|
||||||
#
|
#
|
||||||
# ===================================================================
|
# ====================================================================
|
||||||
# Licensed to the Apache Software Foundation (ASF) under one
|
# Copyright 2002-2010 Justin Erenkrantz and Greg Stein
|
||||||
# or more contributor license agreements. See the NOTICE file
|
#
|
||||||
# distributed with this work for additional information
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# regarding copyright ownership. The ASF licenses this file
|
# you may not use this file except in compliance with the License.
|
||||||
# to you under the Apache License, Version 2.0 (the
|
# You may obtain a copy of the License at
|
||||||
# "License"); you may not use this file except in compliance
|
#
|
||||||
# with the License. You may obtain a copy of the License at
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
#
|
#
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
#
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# Unless required by applicable law or agreed to in writing,
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# software distributed under the License is distributed on an
|
# See the License for the specific language governing permissions and
|
||||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
# limitations under the License.
|
||||||
# KIND, either express or implied. See the License for the
|
# ====================================================================
|
||||||
# specific language governing permissions and limitations
|
#
|
||||||
# under the License.
|
|
||||||
# ===================================================================
|
|
||||||
#
|
#
|
||||||
# Typically, this script is used like:
|
# Typically, this script is used like:
|
||||||
#
|
#
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <apr_pools.h>
|
#include <apr_pools.h>
|
||||||
@ -217,7 +212,7 @@ apr_status_t serf_event_trigger(
|
|||||||
tdesc.desc.s = conn->skt;
|
tdesc.desc.s = conn->skt;
|
||||||
tdesc.reqevents = conn->reqevents;
|
tdesc.reqevents = conn->reqevents;
|
||||||
ctx->pollset_rm(ctx->pollset_baton,
|
ctx->pollset_rm(ctx->pollset_baton,
|
||||||
&tdesc, &conn->baton);
|
&tdesc, conn);
|
||||||
return conn->status;
|
return conn->status;
|
||||||
}
|
}
|
||||||
/* apr_pollset_poll() can return a conn multiple times... */
|
/* apr_pollset_poll() can return a conn multiple times... */
|
||||||
@ -238,7 +233,7 @@ apr_status_t serf_event_trigger(
|
|||||||
tdesc.desc.s = conn->skt;
|
tdesc.desc.s = conn->skt;
|
||||||
tdesc.reqevents = conn->reqevents;
|
tdesc.reqevents = conn->reqevents;
|
||||||
ctx->pollset_rm(ctx->pollset_baton,
|
ctx->pollset_rm(ctx->pollset_baton,
|
||||||
&tdesc, &conn->baton);
|
&tdesc, conn);
|
||||||
}
|
}
|
||||||
return conn->status;
|
return conn->status;
|
||||||
}
|
}
|
||||||
@ -300,9 +295,9 @@ apr_status_t serf_context_run(
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (num--) {
|
while (num--) {
|
||||||
serf_io_baton_t *io = desc->client_data;
|
serf_connection_t *conn = desc->client_data;
|
||||||
|
|
||||||
status = serf_event_trigger(ctx, io, desc);
|
status = serf_event_trigger(ctx, conn, desc);
|
||||||
if (status) {
|
if (status) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <apr_pools.h>
|
#include <apr_pools.h>
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <apr_pools.h>
|
#include <apr_pools.h>
|
||||||
@ -147,7 +142,7 @@ apr_status_t serf__conn_update_pollset(serf_connection_t *conn)
|
|||||||
desc.reqevents = conn->reqevents;
|
desc.reqevents = conn->reqevents;
|
||||||
|
|
||||||
status = ctx->pollset_rm(ctx->pollset_baton,
|
status = ctx->pollset_rm(ctx->pollset_baton,
|
||||||
&desc, &conn->baton);
|
&desc, conn);
|
||||||
if (status && !APR_STATUS_IS_NOTFOUND(status))
|
if (status && !APR_STATUS_IS_NOTFOUND(status))
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
@ -552,7 +547,7 @@ static apr_status_t remove_connection(serf_context_t *ctx,
|
|||||||
desc.reqevents = conn->reqevents;
|
desc.reqevents = conn->reqevents;
|
||||||
|
|
||||||
return ctx->pollset_rm(ctx->pollset_baton,
|
return ctx->pollset_rm(ctx->pollset_baton,
|
||||||
&desc, &conn->baton);
|
&desc, conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A socket was closed, inform the application. */
|
/* A socket was closed, inform the application. */
|
||||||
@ -628,11 +623,6 @@ static apr_status_t reset_connection(serf_connection_t *conn,
|
|||||||
conn->ctx->dirty_pollset = 1;
|
conn->ctx->dirty_pollset = 1;
|
||||||
conn->state = SERF_CONN_INIT;
|
conn->state = SERF_CONN_INIT;
|
||||||
|
|
||||||
conn->hit_eof = 0;
|
|
||||||
conn->connect_time = 0;
|
|
||||||
conn->latency = -1;
|
|
||||||
conn->stop_writing = 0;
|
|
||||||
|
|
||||||
serf__log(CONN_VERBOSE, __FILE__, "reset connection 0x%x\n", conn);
|
serf__log(CONN_VERBOSE, __FILE__, "reset connection 0x%x\n", conn);
|
||||||
|
|
||||||
conn->status = APR_SUCCESS;
|
conn->status = APR_SUCCESS;
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SERF_H
|
#ifndef SERF_H
|
||||||
@ -1067,7 +1062,7 @@ void serf_debug__bucket_alloc_check(
|
|||||||
/* Version info */
|
/* Version info */
|
||||||
#define SERF_MAJOR_VERSION 1
|
#define SERF_MAJOR_VERSION 1
|
||||||
#define SERF_MINOR_VERSION 3
|
#define SERF_MINOR_VERSION 3
|
||||||
#define SERF_PATCH_VERSION 9
|
#define SERF_PATCH_VERSION 8
|
||||||
|
|
||||||
/* Version number string */
|
/* Version number string */
|
||||||
#define SERF_VERSION_STRING APR_STRINGIFY(SERF_MAJOR_VERSION) "." \
|
#define SERF_VERSION_STRING APR_STRINGIFY(SERF_MAJOR_VERSION) "." \
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SERF_BUCKET_TYPES_H
|
#ifndef SERF_BUCKET_TYPES_H
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SERF_BUCKET_UTIL_H
|
#ifndef SERF_BUCKET_UTIL_H
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SERF_PRIVATE_H_
|
#ifndef _SERF_PRIVATE_H_
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/* ====================================================================
|
/* Copyright 2011 Justin Erenkrantz and Greg Stein
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* software distributed under the License is distributed on an
|
*
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* KIND, either express or implied. See the License for the
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* specific language governing permissions and limitations
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* under the License.
|
* See the License for the specific language governing permissions and
|
||||||
* ====================================================================
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*** Setup a SSL tunnel over a HTTP proxy, according to RFC 2817. ***/
|
/*** Setup a SSL tunnel over a HTTP proxy, according to RFC 2817. ***/
|
||||||
|
@ -207,9 +207,9 @@ fb64_start(struct fb *fbp, int dir, int server __unused)
|
|||||||
/*
|
/*
|
||||||
* Create a random feed and send it over.
|
* Create a random feed and send it over.
|
||||||
*/
|
*/
|
||||||
DES_random_key((Block *)fbp->temp_feed);
|
des_random_key((Block *)fbp->temp_feed);
|
||||||
DES_ecb_encrypt((Block *)fbp->temp_feed, (Block *)fbp->temp_feed,
|
des_ecb_encrypt((Block *)fbp->temp_feed, (Block *)fbp->temp_feed,
|
||||||
&fbp->krbdes_sched, 1);
|
fbp->krbdes_sched, 1);
|
||||||
p = fbp->fb_feed + 3;
|
p = fbp->fb_feed + 3;
|
||||||
*p++ = ENCRYPT_IS;
|
*p++ = ENCRYPT_IS;
|
||||||
p++;
|
p++;
|
||||||
@ -393,7 +393,7 @@ fb64_session(Session_Key *key, int server, struct fb *fbp)
|
|||||||
fb64_stream_key(fbp->krbdes_key, &fbp->streams[DIR_ENCRYPT-1]);
|
fb64_stream_key(fbp->krbdes_key, &fbp->streams[DIR_ENCRYPT-1]);
|
||||||
fb64_stream_key(fbp->krbdes_key, &fbp->streams[DIR_DECRYPT-1]);
|
fb64_stream_key(fbp->krbdes_key, &fbp->streams[DIR_DECRYPT-1]);
|
||||||
|
|
||||||
DES_key_sched((Block *)fbp->krbdes_key, &fbp->krbdes_sched);
|
des_key_sched((Block *)fbp->krbdes_key, fbp->krbdes_sched);
|
||||||
/*
|
/*
|
||||||
* Now look to see if krbdes_start() was was waiting for
|
* Now look to see if krbdes_start() was was waiting for
|
||||||
* the key to show up. If so, go ahead an call it now
|
* the key to show up. If so, go ahead an call it now
|
||||||
@ -499,7 +499,7 @@ fb64_stream_iv(Block seed, struct stinfo *stp)
|
|||||||
memmove((void *)stp->str_iv, (void *)seed, sizeof(Block));
|
memmove((void *)stp->str_iv, (void *)seed, sizeof(Block));
|
||||||
memmove((void *)stp->str_output, (void *)seed, sizeof(Block));
|
memmove((void *)stp->str_output, (void *)seed, sizeof(Block));
|
||||||
|
|
||||||
DES_key_sched((Block *)stp->str_ikey, &stp->str_sched);
|
des_key_sched((Block *)stp->str_ikey, stp->str_sched);
|
||||||
|
|
||||||
stp->str_index = sizeof(Block);
|
stp->str_index = sizeof(Block);
|
||||||
}
|
}
|
||||||
@ -508,7 +508,7 @@ void
|
|||||||
fb64_stream_key(Block key, struct stinfo *stp)
|
fb64_stream_key(Block key, struct stinfo *stp)
|
||||||
{
|
{
|
||||||
memmove((void *)stp->str_ikey, (void *)key, sizeof(Block));
|
memmove((void *)stp->str_ikey, (void *)key, sizeof(Block));
|
||||||
DES_key_sched((Block *)key, &stp->str_sched);
|
des_key_sched((Block *)key, stp->str_sched);
|
||||||
|
|
||||||
memmove((void *)stp->str_output, (void *)stp->str_iv, sizeof(Block));
|
memmove((void *)stp->str_output, (void *)stp->str_iv, sizeof(Block));
|
||||||
|
|
||||||
@ -547,7 +547,7 @@ cfb64_encrypt(unsigned char *s, int c)
|
|||||||
while (c-- > 0) {
|
while (c-- > 0) {
|
||||||
if (idx == sizeof(Block)) {
|
if (idx == sizeof(Block)) {
|
||||||
Block b;
|
Block b;
|
||||||
DES_ecb_encrypt((Block *)stp->str_output, (Block *)b, &stp->str_sched, 1);
|
des_ecb_encrypt((Block *)stp->str_output, (Block *)b, stp->str_sched, 1);
|
||||||
memmove((void *)stp->str_feed, (void *)b, sizeof(Block));
|
memmove((void *)stp->str_feed, (void *)b, sizeof(Block));
|
||||||
idx = 0;
|
idx = 0;
|
||||||
}
|
}
|
||||||
@ -580,7 +580,7 @@ cfb64_decrypt(int data)
|
|||||||
idx = stp->str_index++;
|
idx = stp->str_index++;
|
||||||
if (idx == sizeof(Block)) {
|
if (idx == sizeof(Block)) {
|
||||||
Block b;
|
Block b;
|
||||||
DES_ecb_encrypt((Block *)stp->str_output, (Block *)b, &stp->str_sched, 1);
|
des_ecb_encrypt((Block *)stp->str_output, (Block *)b, stp->str_sched, 1);
|
||||||
memmove((void *)stp->str_feed, (void *)b, sizeof(Block));
|
memmove((void *)stp->str_feed, (void *)b, sizeof(Block));
|
||||||
stp->str_index = 1; /* Next time will be 1 */
|
stp->str_index = 1; /* Next time will be 1 */
|
||||||
idx = 0; /* But now use 0 */
|
idx = 0; /* But now use 0 */
|
||||||
@ -620,7 +620,7 @@ ofb64_encrypt(unsigned char *s, int c)
|
|||||||
while (c-- > 0) {
|
while (c-- > 0) {
|
||||||
if (idx == sizeof(Block)) {
|
if (idx == sizeof(Block)) {
|
||||||
Block b;
|
Block b;
|
||||||
DES_ecb_encrypt((Block *)stp->str_feed, (Block *)b, &stp->str_sched, 1);
|
des_ecb_encrypt((Block *)stp->str_feed, (Block *)b, stp->str_sched, 1);
|
||||||
memmove((void *)stp->str_feed, (void *)b, sizeof(Block));
|
memmove((void *)stp->str_feed, (void *)b, sizeof(Block));
|
||||||
idx = 0;
|
idx = 0;
|
||||||
}
|
}
|
||||||
@ -650,7 +650,7 @@ ofb64_decrypt(int data)
|
|||||||
idx = stp->str_index++;
|
idx = stp->str_index++;
|
||||||
if (idx == sizeof(Block)) {
|
if (idx == sizeof(Block)) {
|
||||||
Block b;
|
Block b;
|
||||||
DES_ecb_encrypt((Block *)stp->str_feed, (Block *)b, &stp->str_sched, 1);
|
des_ecb_encrypt((Block *)stp->str_feed, (Block *)b, stp->str_sched, 1);
|
||||||
memmove((void *)stp->str_feed, (void *)b, sizeof(Block));
|
memmove((void *)stp->str_feed, (void *)b, sizeof(Block));
|
||||||
stp->str_index = 1; /* Next time will be 1 */
|
stp->str_index = 1; /* Next time will be 1 */
|
||||||
idx = 0; /* But now use 0 */
|
idx = 0; /* But now use 0 */
|
||||||
|
@ -67,7 +67,7 @@ typedef unsigned char *BlockT;
|
|||||||
#if 0
|
#if 0
|
||||||
typedef struct { Block __; } Schedule[16];
|
typedef struct { Block __; } Schedule[16];
|
||||||
#else
|
#else
|
||||||
#define Schedule DES_key_schedule
|
#define Schedule des_key_schedule
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define VALIDKEY(key) ( key[0] | key[1] | key[2] | key[3] | \
|
#define VALIDKEY(key) ( key[0] | key[1] | key[2] | key[3] | \
|
||||||
|
@ -91,7 +91,7 @@ static char name[ANAME_SZ];
|
|||||||
static AUTH_DAT adat = { 0, "", "", "", 0, {}, 0, 0, 0, { 0, "", 0 } };
|
static AUTH_DAT adat = { 0, "", "", "", 0, {}, 0, 0, 0, { 0, "", 0 } };
|
||||||
#ifdef ENCRYPTION
|
#ifdef ENCRYPTION
|
||||||
static Block session_key = { 0 };
|
static Block session_key = { 0 };
|
||||||
static DES_key_schedule sched;
|
static des_key_schedule sched;
|
||||||
static Block challenge = { 0 };
|
static Block challenge = { 0 };
|
||||||
#endif /* ENCRYPTION */
|
#endif /* ENCRYPTION */
|
||||||
|
|
||||||
@ -206,10 +206,10 @@ kerberos4_send(Authenticator *ap)
|
|||||||
if ((ap->way & AUTH_HOW_MASK) == AUTH_HOW_MUTUAL) {
|
if ((ap->way & AUTH_HOW_MASK) == AUTH_HOW_MUTUAL) {
|
||||||
register int i;
|
register int i;
|
||||||
|
|
||||||
DES_key_sched(&cred.session, sched);
|
des_key_sched(&cred.session, sched);
|
||||||
DES_random_key(&session_key);
|
des_random_key(&session_key);
|
||||||
DES_ecb_encrypt(&session_key, &session_key, sched, 0);
|
des_ecb_encrypt(&session_key, &session_key, sched, 0);
|
||||||
DES_ecb_encrypt(&session_key, &challenge, sched, 0);
|
des_ecb_encrypt(&session_key, &challenge, sched, 0);
|
||||||
/*
|
/*
|
||||||
* Increment the challenge by 1, and encrypt it for
|
* Increment the challenge by 1, and encrypt it for
|
||||||
* later comparison.
|
* later comparison.
|
||||||
@ -221,7 +221,7 @@ kerberos4_send(Authenticator *ap)
|
|||||||
if (x < 256) /* if no overflow, all done */
|
if (x < 256) /* if no overflow, all done */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
DES_ecb_encrypt(&challenge, &challenge, sched, 1);
|
des_ecb_encrypt(&challenge, &challenge, sched, 1);
|
||||||
}
|
}
|
||||||
#endif /* ENCRYPTION */
|
#endif /* ENCRYPTION */
|
||||||
|
|
||||||
@ -298,14 +298,14 @@ kerberos4_is(Authenticator *ap, unsigned char *data, int cnt)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
DES_key_sched(&session_key, sched);
|
des_key_sched(&session_key, sched);
|
||||||
memmove((void *)datablock, (void *)data, sizeof(Block));
|
memmove((void *)datablock, (void *)data, sizeof(Block));
|
||||||
/*
|
/*
|
||||||
* Take the received encrypted challenge, and encrypt
|
* Take the received encrypted challenge, and encrypt
|
||||||
* it again to get a unique session_key for the
|
* it again to get a unique session_key for the
|
||||||
* ENCRYPT option.
|
* ENCRYPT option.
|
||||||
*/
|
*/
|
||||||
DES_ecb_encrypt(&datablock, &session_key, sched, 1);
|
des_ecb_encrypt(&datablock, &session_key, sched, 1);
|
||||||
skey.type = SK_DES;
|
skey.type = SK_DES;
|
||||||
skey.length = 8;
|
skey.length = 8;
|
||||||
skey.data = session_key;
|
skey.data = session_key;
|
||||||
@ -314,7 +314,7 @@ kerberos4_is(Authenticator *ap, unsigned char *data, int cnt)
|
|||||||
* Now decrypt the received encrypted challenge,
|
* Now decrypt the received encrypted challenge,
|
||||||
* increment by one, re-encrypt it and send it back.
|
* increment by one, re-encrypt it and send it back.
|
||||||
*/
|
*/
|
||||||
DES_ecb_encrypt(&datablock, &challenge, sched, 0);
|
des_ecb_encrypt(&datablock, &challenge, sched, 0);
|
||||||
for (r = 7; r >= 0; r--) {
|
for (r = 7; r >= 0; r--) {
|
||||||
register int t;
|
register int t;
|
||||||
t = (unsigned int)challenge[r] + 1;
|
t = (unsigned int)challenge[r] + 1;
|
||||||
@ -322,7 +322,7 @@ kerberos4_is(Authenticator *ap, unsigned char *data, int cnt)
|
|||||||
if (t < 256) /* if no overflow, all done */
|
if (t < 256) /* if no overflow, all done */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
DES_ecb_encrypt(&challenge, &challenge, sched, 1);
|
des_ecb_encrypt(&challenge, &challenge, sched, 1);
|
||||||
Data(ap, KRB_RESPONSE, challenge, sizeof(challenge));
|
Data(ap, KRB_RESPONSE, challenge, sizeof(challenge));
|
||||||
#endif /* ENCRYPTION */
|
#endif /* ENCRYPTION */
|
||||||
break;
|
break;
|
||||||
@ -364,7 +364,7 @@ kerberos4_reply(Authenticator *ap, unsigned char *data, int cnt)
|
|||||||
#else /* ENCRYPTION */
|
#else /* ENCRYPTION */
|
||||||
Data(ap, KRB_CHALLENGE, session_key,
|
Data(ap, KRB_CHALLENGE, session_key,
|
||||||
sizeof(session_key));
|
sizeof(session_key));
|
||||||
DES_ecb_encrypt(&session_key, &session_key, sched, 1);
|
des_ecb_encrypt(&session_key, &session_key, sched, 1);
|
||||||
skey.type = SK_DES;
|
skey.type = SK_DES;
|
||||||
skey.length = 8;
|
skey.length = 8;
|
||||||
skey.data = session_key;
|
skey.data = session_key;
|
||||||
|
@ -129,7 +129,7 @@ common_key(char *xsecret, char *xpublic, IdeaData *ideakey, DesData *deskey)
|
|||||||
mp_pow(public, secret, modulus, common);
|
mp_pow(public, secret, modulus, common);
|
||||||
extractdeskey(common, deskey);
|
extractdeskey(common, deskey);
|
||||||
extractideakey(common, ideakey);
|
extractideakey(common, ideakey);
|
||||||
DES_set_odd_parity(deskey);
|
des_set_odd_parity(deskey);
|
||||||
mp_mfree(common);
|
mp_mfree(common);
|
||||||
mp_mfree(secret);
|
mp_mfree(secret);
|
||||||
mp_mfree(public);
|
mp_mfree(public);
|
||||||
@ -221,14 +221,14 @@ pk_encode(char *in, char *out, DesData *key)
|
|||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
DesData i;
|
DesData i;
|
||||||
DES_key_schedule k;
|
des_key_schedule k;
|
||||||
int l,op,deslen;
|
int l,op,deslen;
|
||||||
|
|
||||||
memset(&i,0,sizeof(i));
|
memset(&i,0,sizeof(i));
|
||||||
memset(buf,0,sizeof(buf));
|
memset(buf,0,sizeof(buf));
|
||||||
deslen = ((strlen(in) + 7)/8)*8;
|
deslen = ((strlen(in) + 7)/8)*8;
|
||||||
DES_key_sched(key, &k);
|
des_key_sched(key, k);
|
||||||
DES_cbc_encrypt(in, buf, deslen, &k, &i, DES_ENCRYPT);
|
des_cbc_encrypt(in,buf,deslen, k,&i,DES_ENCRYPT);
|
||||||
for (l=0,op=0;l<deslen;l++) {
|
for (l=0,op=0;l<deslen;l++) {
|
||||||
out[op++] = hextab[(buf[l] & 0xf0) >> 4];
|
out[op++] = hextab[(buf[l] & 0xf0) >> 4];
|
||||||
out[op++] = hextab[(buf[l] & 0x0f)];
|
out[op++] = hextab[(buf[l] & 0x0f)];
|
||||||
@ -242,7 +242,7 @@ pk_decode(char *in, char *out, DesData *key)
|
|||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
DesData i;
|
DesData i;
|
||||||
DES_key_schedule k;
|
des_key_schedule k;
|
||||||
int n1,n2,op;
|
int n1,n2,op;
|
||||||
size_t l;
|
size_t l;
|
||||||
|
|
||||||
@ -259,7 +259,7 @@ pk_decode(char *in, char *out, DesData *key)
|
|||||||
n2 = in[op+1] - '0';
|
n2 = in[op+1] - '0';
|
||||||
buf[l] = n1*16 +n2;
|
buf[l] = n1*16 +n2;
|
||||||
}
|
}
|
||||||
DES_key_sched(key, &k);
|
des_key_sched(key, k);
|
||||||
DES_cbc_encrypt(buf, out, strlen(in) / 2, &k, &i, DES_DECRYPT);
|
des_cbc_encrypt(buf,out,strlen(in)/2, k,&i,DES_DECRYPT);
|
||||||
out[strlen(in)/2] = '\0';
|
out[strlen(in)/2] = '\0';
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
/* header for the des routines that we will use */
|
/* header for the des routines that we will use */
|
||||||
|
|
||||||
typedef unsigned char byte, DesData[ 8], IdeaData[16];
|
typedef unsigned char byte, DesData[ 8], IdeaData[16];
|
||||||
#define DesKeys DES_key_schedule
|
#define DesKeys des_key_schedule
|
||||||
|
|
||||||
#define DES_DECRYPT 0
|
#define DES_DECRYPT 0
|
||||||
#define DES_ENCRYPT 1
|
#define DES_ENCRYPT 1
|
||||||
|
@ -135,7 +135,7 @@
|
|||||||
#define HAVE_DLFCN_H 1
|
#define HAVE_DLFCN_H 1
|
||||||
|
|
||||||
/* Define to 1 if you have the `DSA_SIG_set0' function. */
|
/* Define to 1 if you have the `DSA_SIG_set0' function. */
|
||||||
#define HAVE_DSA_SIG_SET0 1
|
/* #undef HAVE_DSA_SIG_SET0 */
|
||||||
|
|
||||||
/* Define to 1 if you have the <endian.h> header file. */
|
/* Define to 1 if you have the <endian.h> header file. */
|
||||||
/* #undef HAVE_ENDIAN_H */
|
/* #undef HAVE_ENDIAN_H */
|
||||||
@ -177,10 +177,10 @@
|
|||||||
/* #undef HAVE_EVP_DIGESTVERIFY */
|
/* #undef HAVE_EVP_DIGESTVERIFY */
|
||||||
|
|
||||||
/* Define to 1 if you have the `EVP_dss1' function. */
|
/* Define to 1 if you have the `EVP_dss1' function. */
|
||||||
/* #undef HAVE_EVP_DSS1 */
|
#define HAVE_EVP_DSS1 1
|
||||||
|
|
||||||
/* Define to 1 if you have the `EVP_MD_CTX_new' function. */
|
/* Define to 1 if you have the `EVP_MD_CTX_new' function. */
|
||||||
#define HAVE_EVP_MD_CTX_NEW 1
|
/* #undef HAVE_EVP_MD_CTX_NEW */
|
||||||
|
|
||||||
/* Define to 1 if you have the `EVP_sha1' function. */
|
/* Define to 1 if you have the `EVP_sha1' function. */
|
||||||
#define HAVE_EVP_SHA1 1
|
#define HAVE_EVP_SHA1 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user