├── 3rdparty ├── libuv │ ├── include │ │ ├── uv.h │ │ └── uv │ │ │ ├── aix.h │ │ │ ├── android-ifaddrs.h │ │ │ ├── bsd.h │ │ │ ├── darwin.h │ │ │ ├── errno.h │ │ │ ├── linux.h │ │ │ ├── os390.h │ │ │ ├── posix.h │ │ │ ├── stdint-msvc2008.h │ │ │ ├── sunos.h │ │ │ ├── threadpool.h │ │ │ ├── tree.h │ │ │ ├── unix.h │ │ │ ├── version.h │ │ │ └── win.h │ ├── lib │ │ ├── linux_lib_x64 │ │ │ ├── libuv.so │ │ │ ├── libuv.so.1 │ │ │ ├── libuv.so.1.0.0 │ │ │ └── libuv_a.a │ │ ├── vc_lib │ │ │ ├── libuv.lib │ │ │ └── libuvd.lib │ │ └── vc_lib_x64 │ │ │ ├── libuv.lib │ │ │ └── libuvd.lib │ └── readme.txt └── openssl │ ├── include │ └── openssl │ │ ├── aes.h │ │ ├── asn1.h │ │ ├── asn1_mac.h │ │ ├── asn1t.h │ │ ├── bio.h │ │ ├── blowfish.h │ │ ├── bn.h │ │ ├── buffer.h │ │ ├── camellia.h │ │ ├── cast.h │ │ ├── cmac.h │ │ ├── cms.h │ │ ├── comp.h │ │ ├── conf.h │ │ ├── conf_api.h │ │ ├── crypto.h │ │ ├── des.h │ │ ├── des_old.h │ │ ├── dh.h │ │ ├── dsa.h │ │ ├── dso.h │ │ ├── dtls1.h │ │ ├── e_os2.h │ │ ├── ebcdic.h │ │ ├── ec.h │ │ ├── ecdh.h │ │ ├── ecdsa.h │ │ ├── engine.h │ │ ├── err.h │ │ ├── evp.h │ │ ├── hmac.h │ │ ├── idea.h │ │ ├── krb5_asn.h │ │ ├── kssl.h │ │ ├── lhash.h │ │ ├── md4.h │ │ ├── md5.h │ │ ├── mdc2.h │ │ ├── modes.h │ │ ├── obj_mac.h │ │ ├── objects.h │ │ ├── ocsp.h │ │ ├── opensslconf.h │ │ ├── opensslv.h │ │ ├── ossl_typ.h │ │ ├── pem.h │ │ ├── pem2.h │ │ ├── pkcs12.h │ │ ├── pkcs7.h │ │ ├── pqueue.h │ │ ├── rand.h │ │ ├── rc2.h │ │ ├── rc4.h │ │ ├── ripemd.h │ │ ├── rsa.h │ │ ├── safestack.h │ │ ├── seed.h │ │ ├── sha.h │ │ ├── srp.h │ │ ├── srtp.h │ │ ├── ssl.h │ │ ├── ssl2.h │ │ ├── ssl23.h │ │ ├── ssl3.h │ │ ├── stack.h │ │ ├── symhacks.h │ │ ├── tls1.h │ │ ├── ts.h │ │ ├── txt_db.h │ │ ├── ui.h │ │ ├── ui_compat.h │ │ ├── whrlpool.h │ │ ├── x509.h │ │ ├── x509_vfy.h │ │ └── x509v3.h │ ├── lib │ ├── linux_lib_x64 │ │ ├── libcrypto.a │ │ └── libssl.a │ ├── vc_lib │ │ ├── libeay32.lib │ │ ├── libeay32d.lib │ │ ├── ssleay32.lib │ │ └── ssleay32d.lib │ └── vc_lib_x64 │ │ ├── libeay32.lib │ │ ├── libeay32d.lib │ │ ├── ssleay32.lib │ │ └── ssleay32d.lib │ └── readme.txt ├── CMakeLists.txt ├── LICENSE ├── README.md ├── log4z ├── log4z.cpp └── log4z.h ├── net ├── net_base.h └── packet_sync.h ├── pod_circularbuffer.h ├── sys └── thread_uv.h ├── tcpclient.cpp ├── tcpclient.h ├── tcpserver.cpp ├── tcpserver.h ├── tcpserverprotocolprocess.h ├── test_tcpclient.cpp ├── test_tcpclient_reconnect.cpp └── test_tcpserver.cpp /3rdparty/libuv/include/uv/aix.h: -------------------------------------------------------------------------------- 1 | /* Copyright Joyent, Inc. and other Node contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef UV_AIX_H 23 | #define UV_AIX_H 24 | 25 | #define UV_PLATFORM_LOOP_FIELDS \ 26 | int fs_fd; \ 27 | 28 | #define UV_PLATFORM_FS_EVENT_FIELDS \ 29 | uv__io_t event_watcher; \ 30 | char *dir_filename; \ 31 | 32 | #endif /* UV_AIX_H */ 33 | -------------------------------------------------------------------------------- /3rdparty/libuv/include/uv/android-ifaddrs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1995, 1999 3 | * Berkeley Software Design, Inc. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND 12 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 13 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 14 | * ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE 15 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 16 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 17 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 18 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 19 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 20 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 21 | * SUCH DAMAGE. 22 | * 23 | * BSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp 24 | */ 25 | 26 | #ifndef _IFADDRS_H_ 27 | #define _IFADDRS_H_ 28 | 29 | struct ifaddrs { 30 | struct ifaddrs *ifa_next; 31 | char *ifa_name; 32 | unsigned int ifa_flags; 33 | struct sockaddr *ifa_addr; 34 | struct sockaddr *ifa_netmask; 35 | struct sockaddr *ifa_dstaddr; 36 | void *ifa_data; 37 | }; 38 | 39 | /* 40 | * This may have been defined in . Note that if is 41 | * to be included it must be included before this header file. 42 | */ 43 | #ifndef ifa_broadaddr 44 | #define ifa_broadaddr ifa_dstaddr /* broadcast address interface */ 45 | #endif 46 | 47 | #include 48 | 49 | __BEGIN_DECLS 50 | extern int getifaddrs(struct ifaddrs **ifap); 51 | extern void freeifaddrs(struct ifaddrs *ifa); 52 | __END_DECLS 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /3rdparty/libuv/include/uv/bsd.h: -------------------------------------------------------------------------------- 1 | /* Copyright Joyent, Inc. and other Node contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef UV_BSD_H 23 | #define UV_BSD_H 24 | 25 | #define UV_PLATFORM_FS_EVENT_FIELDS \ 26 | uv__io_t event_watcher; \ 27 | 28 | #define UV_IO_PRIVATE_PLATFORM_FIELDS \ 29 | int rcount; \ 30 | int wcount; \ 31 | 32 | #define UV_HAVE_KQUEUE 1 33 | 34 | #endif /* UV_BSD_H */ 35 | -------------------------------------------------------------------------------- /3rdparty/libuv/include/uv/darwin.h: -------------------------------------------------------------------------------- 1 | /* Copyright Joyent, Inc. and other Node contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef UV_DARWIN_H 23 | #define UV_DARWIN_H 24 | 25 | #if defined(__APPLE__) && defined(__MACH__) 26 | # include 27 | # include 28 | # include 29 | # include 30 | # define UV_PLATFORM_SEM_T semaphore_t 31 | #endif 32 | 33 | #define UV_IO_PRIVATE_PLATFORM_FIELDS \ 34 | int rcount; \ 35 | int wcount; \ 36 | 37 | #define UV_PLATFORM_LOOP_FIELDS \ 38 | uv_thread_t cf_thread; \ 39 | void* _cf_reserved; \ 40 | void* cf_state; \ 41 | uv_mutex_t cf_mutex; \ 42 | uv_sem_t cf_sem; \ 43 | void* cf_signals[2]; \ 44 | 45 | #define UV_PLATFORM_FS_EVENT_FIELDS \ 46 | uv__io_t event_watcher; \ 47 | char* realpath; \ 48 | int realpath_len; \ 49 | int cf_flags; \ 50 | uv_async_t* cf_cb; \ 51 | void* cf_events[2]; \ 52 | void* cf_member[2]; \ 53 | int cf_error; \ 54 | uv_mutex_t cf_mutex; \ 55 | 56 | #define UV_STREAM_PRIVATE_PLATFORM_FIELDS \ 57 | void* select; \ 58 | 59 | #define UV_HAVE_KQUEUE 1 60 | 61 | #endif /* UV_DARWIN_H */ 62 | -------------------------------------------------------------------------------- /3rdparty/libuv/include/uv/linux.h: -------------------------------------------------------------------------------- 1 | /* Copyright Joyent, Inc. and other Node contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef UV_LINUX_H 23 | #define UV_LINUX_H 24 | 25 | #define UV_PLATFORM_LOOP_FIELDS \ 26 | uv__io_t inotify_read_watcher; \ 27 | void* inotify_watchers; \ 28 | int inotify_fd; \ 29 | 30 | #define UV_PLATFORM_FS_EVENT_FIELDS \ 31 | void* watchers[2]; \ 32 | int wd; \ 33 | 34 | #endif /* UV_LINUX_H */ 35 | -------------------------------------------------------------------------------- /3rdparty/libuv/include/uv/os390.h: -------------------------------------------------------------------------------- 1 | /* Copyright libuv project contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef UV_MVS_H 23 | #define UV_MVS_H 24 | 25 | #define UV_PLATFORM_SEM_T long 26 | 27 | #define UV_PLATFORM_LOOP_FIELDS \ 28 | void* ep; \ 29 | 30 | #define UV_PLATFORM_FS_EVENT_FIELDS \ 31 | char rfis_rftok[8]; \ 32 | 33 | #endif /* UV_MVS_H */ 34 | -------------------------------------------------------------------------------- /3rdparty/libuv/include/uv/posix.h: -------------------------------------------------------------------------------- 1 | /* Copyright libuv project contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef UV_POSIX_H 23 | #define UV_POSIX_H 24 | 25 | #define UV_PLATFORM_LOOP_FIELDS \ 26 | struct pollfd* poll_fds; \ 27 | size_t poll_fds_used; \ 28 | size_t poll_fds_size; \ 29 | unsigned char poll_fds_iterating; \ 30 | 31 | #endif /* UV_POSIX_H */ 32 | -------------------------------------------------------------------------------- /3rdparty/libuv/include/uv/sunos.h: -------------------------------------------------------------------------------- 1 | /* Copyright Joyent, Inc. and other Node contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef UV_SUNOS_H 23 | #define UV_SUNOS_H 24 | 25 | #include 26 | #include 27 | 28 | /* For the sake of convenience and reduced #ifdef-ery in src/unix/sunos.c, 29 | * add the fs_event fields even when this version of SunOS doesn't support 30 | * file watching. 31 | */ 32 | #define UV_PLATFORM_LOOP_FIELDS \ 33 | uv__io_t fs_event_watcher; \ 34 | int fs_fd; \ 35 | 36 | #if defined(PORT_SOURCE_FILE) 37 | 38 | # define UV_PLATFORM_FS_EVENT_FIELDS \ 39 | file_obj_t fo; \ 40 | int fd; \ 41 | 42 | #endif /* defined(PORT_SOURCE_FILE) */ 43 | 44 | #endif /* UV_SUNOS_H */ 45 | -------------------------------------------------------------------------------- /3rdparty/libuv/include/uv/threadpool.h: -------------------------------------------------------------------------------- 1 | /* Copyright Joyent, Inc. and other Node contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | /* 23 | * This file is private to libuv. It provides common functionality to both 24 | * Windows and Unix backends. 25 | */ 26 | 27 | #ifndef UV_THREADPOOL_H_ 28 | #define UV_THREADPOOL_H_ 29 | 30 | struct uv__work { 31 | void (*work)(struct uv__work *w); 32 | void (*done)(struct uv__work *w, int status); 33 | struct uv_loop_s* loop; 34 | void* wq[2]; 35 | }; 36 | 37 | #endif /* UV_THREADPOOL_H_ */ 38 | -------------------------------------------------------------------------------- /3rdparty/libuv/include/uv/version.h: -------------------------------------------------------------------------------- 1 | /* Copyright Joyent, Inc. and other Node contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef UV_VERSION_H 23 | #define UV_VERSION_H 24 | 25 | /* 26 | * Versions with the same major number are ABI stable. API is allowed to 27 | * evolve between minor releases, but only in a backwards compatible way. 28 | * Make sure you update the -soname directives in configure.ac 29 | * whenever you bump UV_VERSION_MAJOR or UV_VERSION_MINOR (but 30 | * not UV_VERSION_PATCH.) 31 | */ 32 | 33 | #define UV_VERSION_MAJOR 1 34 | #define UV_VERSION_MINOR 42 35 | #define UV_VERSION_PATCH 0 36 | #define UV_VERSION_IS_RELEASE 1 37 | #define UV_VERSION_SUFFIX "" 38 | 39 | #define UV_VERSION_HEX ((UV_VERSION_MAJOR << 16) | \ 40 | (UV_VERSION_MINOR << 8) | \ 41 | (UV_VERSION_PATCH)) 42 | 43 | #endif /* UV_VERSION_H */ 44 | -------------------------------------------------------------------------------- /3rdparty/libuv/lib/linux_lib_x64/libuv.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wqvbjhc/libuv_tcp/8be9bf2df6a230ae53a1ea88b5bd1321d39811a7/3rdparty/libuv/lib/linux_lib_x64/libuv.so -------------------------------------------------------------------------------- /3rdparty/libuv/lib/linux_lib_x64/libuv.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wqvbjhc/libuv_tcp/8be9bf2df6a230ae53a1ea88b5bd1321d39811a7/3rdparty/libuv/lib/linux_lib_x64/libuv.so.1 -------------------------------------------------------------------------------- /3rdparty/libuv/lib/linux_lib_x64/libuv.so.1.0.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wqvbjhc/libuv_tcp/8be9bf2df6a230ae53a1ea88b5bd1321d39811a7/3rdparty/libuv/lib/linux_lib_x64/libuv.so.1.0.0 -------------------------------------------------------------------------------- /3rdparty/libuv/lib/linux_lib_x64/libuv_a.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wqvbjhc/libuv_tcp/8be9bf2df6a230ae53a1ea88b5bd1321d39811a7/3rdparty/libuv/lib/linux_lib_x64/libuv_a.a -------------------------------------------------------------------------------- /3rdparty/libuv/lib/vc_lib/libuv.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wqvbjhc/libuv_tcp/8be9bf2df6a230ae53a1ea88b5bd1321d39811a7/3rdparty/libuv/lib/vc_lib/libuv.lib -------------------------------------------------------------------------------- /3rdparty/libuv/lib/vc_lib/libuvd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wqvbjhc/libuv_tcp/8be9bf2df6a230ae53a1ea88b5bd1321d39811a7/3rdparty/libuv/lib/vc_lib/libuvd.lib -------------------------------------------------------------------------------- /3rdparty/libuv/lib/vc_lib_x64/libuv.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wqvbjhc/libuv_tcp/8be9bf2df6a230ae53a1ea88b5bd1321d39811a7/3rdparty/libuv/lib/vc_lib_x64/libuv.lib -------------------------------------------------------------------------------- /3rdparty/libuv/lib/vc_lib_x64/libuvd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wqvbjhc/libuv_tcp/8be9bf2df6a230ae53a1ea88b5bd1321d39811a7/3rdparty/libuv/lib/vc_lib_x64/libuvd.lib -------------------------------------------------------------------------------- /3rdparty/libuv/readme.txt: -------------------------------------------------------------------------------- 1 | Github: https://github.com/joyent/libuv 2 | Version: 1.42.0 -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/aes.h: -------------------------------------------------------------------------------- 1 | /* crypto/aes/aes.h */ 2 | /* ==================================================================== 3 | * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in 14 | * the documentation and/or other materials provided with the 15 | * distribution. 16 | * 17 | * 3. All advertising materials mentioning features or use of this 18 | * software must display the following acknowledgment: 19 | * "This product includes software developed by the OpenSSL Project 20 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 21 | * 22 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 23 | * endorse or promote products derived from this software without 24 | * prior written permission. For written permission, please contact 25 | * openssl-core@openssl.org. 26 | * 27 | * 5. Products derived from this software may not be called "OpenSSL" 28 | * nor may "OpenSSL" appear in their names without prior written 29 | * permission of the OpenSSL Project. 30 | * 31 | * 6. Redistributions of any form whatsoever must retain the following 32 | * acknowledgment: 33 | * "This product includes software developed by the OpenSSL Project 34 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 35 | * 36 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 37 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 38 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 39 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 40 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 41 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 42 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 44 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 45 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 46 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 47 | * OF THE POSSIBILITY OF SUCH DAMAGE. 48 | * ==================================================================== 49 | * 50 | */ 51 | 52 | #ifndef HEADER_AES_H 53 | # define HEADER_AES_H 54 | 55 | # include 56 | 57 | # ifdef OPENSSL_NO_AES 58 | # error AES is disabled. 59 | # endif 60 | 61 | # include 62 | 63 | # define AES_ENCRYPT 1 64 | # define AES_DECRYPT 0 65 | 66 | /* 67 | * Because array size can't be a const in C, the following two are macros. 68 | * Both sizes are in bytes. 69 | */ 70 | # define AES_MAXNR 14 71 | # define AES_BLOCK_SIZE 16 72 | 73 | #ifdef __cplusplus 74 | extern "C" { 75 | #endif 76 | 77 | /* This should be a hidden type, but EVP requires that the size be known */ 78 | struct aes_key_st { 79 | # ifdef AES_LONG 80 | unsigned long rd_key[4 * (AES_MAXNR + 1)]; 81 | # else 82 | unsigned int rd_key[4 * (AES_MAXNR + 1)]; 83 | # endif 84 | int rounds; 85 | }; 86 | typedef struct aes_key_st AES_KEY; 87 | 88 | const char *AES_options(void); 89 | 90 | int AES_set_encrypt_key(const unsigned char *userKey, const int bits, 91 | AES_KEY *key); 92 | int AES_set_decrypt_key(const unsigned char *userKey, const int bits, 93 | AES_KEY *key); 94 | 95 | int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, 96 | AES_KEY *key); 97 | int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, 98 | AES_KEY *key); 99 | 100 | void AES_encrypt(const unsigned char *in, unsigned char *out, 101 | const AES_KEY *key); 102 | void AES_decrypt(const unsigned char *in, unsigned char *out, 103 | const AES_KEY *key); 104 | 105 | void AES_ecb_encrypt(const unsigned char *in, unsigned char *out, 106 | const AES_KEY *key, const int enc); 107 | void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, 108 | size_t length, const AES_KEY *key, 109 | unsigned char *ivec, const int enc); 110 | void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out, 111 | size_t length, const AES_KEY *key, 112 | unsigned char *ivec, int *num, const int enc); 113 | void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out, 114 | size_t length, const AES_KEY *key, 115 | unsigned char *ivec, int *num, const int enc); 116 | void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, 117 | size_t length, const AES_KEY *key, 118 | unsigned char *ivec, int *num, const int enc); 119 | void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out, 120 | size_t length, const AES_KEY *key, 121 | unsigned char *ivec, int *num); 122 | void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out, 123 | size_t length, const AES_KEY *key, 124 | unsigned char ivec[AES_BLOCK_SIZE], 125 | unsigned char ecount_buf[AES_BLOCK_SIZE], 126 | unsigned int *num); 127 | /* NB: the IV is _two_ blocks long */ 128 | void AES_ige_encrypt(const unsigned char *in, unsigned char *out, 129 | size_t length, const AES_KEY *key, 130 | unsigned char *ivec, const int enc); 131 | /* NB: the IV is _four_ blocks long */ 132 | void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out, 133 | size_t length, const AES_KEY *key, 134 | const AES_KEY *key2, const unsigned char *ivec, 135 | const int enc); 136 | 137 | int AES_wrap_key(AES_KEY *key, const unsigned char *iv, 138 | unsigned char *out, 139 | const unsigned char *in, unsigned int inlen); 140 | int AES_unwrap_key(AES_KEY *key, const unsigned char *iv, 141 | unsigned char *out, 142 | const unsigned char *in, unsigned int inlen); 143 | 144 | 145 | #ifdef __cplusplus 146 | } 147 | #endif 148 | 149 | #endif /* !HEADER_AES_H */ 150 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/blowfish.h: -------------------------------------------------------------------------------- 1 | /* crypto/bf/blowfish.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_BLOWFISH_H 60 | # define HEADER_BLOWFISH_H 61 | 62 | # include 63 | 64 | #ifdef __cplusplus 65 | extern "C" { 66 | #endif 67 | 68 | # ifdef OPENSSL_NO_BF 69 | # error BF is disabled. 70 | # endif 71 | 72 | # define BF_ENCRYPT 1 73 | # define BF_DECRYPT 0 74 | 75 | /*- 76 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 77 | * ! BF_LONG has to be at least 32 bits wide. If it's wider, then ! 78 | * ! BF_LONG_LOG2 has to be defined along. ! 79 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 80 | */ 81 | 82 | # if defined(__LP32__) 83 | # define BF_LONG unsigned long 84 | # elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) 85 | # define BF_LONG unsigned long 86 | # define BF_LONG_LOG2 3 87 | /* 88 | * _CRAY note. I could declare short, but I have no idea what impact 89 | * does it have on performance on none-T3E machines. I could declare 90 | * int, but at least on C90 sizeof(int) can be chosen at compile time. 91 | * So I've chosen long... 92 | * 93 | */ 94 | # else 95 | # define BF_LONG unsigned int 96 | # endif 97 | 98 | # define BF_ROUNDS 16 99 | # define BF_BLOCK 8 100 | 101 | typedef struct bf_key_st { 102 | BF_LONG P[BF_ROUNDS + 2]; 103 | BF_LONG S[4 * 256]; 104 | } BF_KEY; 105 | 106 | # ifdef OPENSSL_FIPS 107 | void private_BF_set_key(BF_KEY *key, int len, const unsigned char *data); 108 | # endif 109 | void BF_set_key(BF_KEY *key, int len, const unsigned char *data); 110 | 111 | void BF_encrypt(BF_LONG *data, const BF_KEY *key); 112 | void BF_decrypt(BF_LONG *data, const BF_KEY *key); 113 | 114 | void BF_ecb_encrypt(const unsigned char *in, unsigned char *out, 115 | const BF_KEY *key, int enc); 116 | void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, 117 | const BF_KEY *schedule, unsigned char *ivec, int enc); 118 | void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out, 119 | long length, const BF_KEY *schedule, 120 | unsigned char *ivec, int *num, int enc); 121 | void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out, 122 | long length, const BF_KEY *schedule, 123 | unsigned char *ivec, int *num); 124 | const char *BF_options(void); 125 | 126 | #ifdef __cplusplus 127 | } 128 | #endif 129 | 130 | #endif 131 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/buffer.h: -------------------------------------------------------------------------------- 1 | /* crypto/buffer/buffer.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_BUFFER_H 60 | # define HEADER_BUFFER_H 61 | 62 | # include 63 | 64 | #ifdef __cplusplus 65 | extern "C" { 66 | #endif 67 | 68 | # include 69 | 70 | # if !defined(NO_SYS_TYPES_H) 71 | # include 72 | # endif 73 | 74 | /* Already declared in ossl_typ.h */ 75 | /* typedef struct buf_mem_st BUF_MEM; */ 76 | 77 | struct buf_mem_st { 78 | size_t length; /* current number of bytes */ 79 | char *data; 80 | size_t max; /* size of buffer */ 81 | }; 82 | 83 | BUF_MEM *BUF_MEM_new(void); 84 | void BUF_MEM_free(BUF_MEM *a); 85 | int BUF_MEM_grow(BUF_MEM *str, size_t len); 86 | int BUF_MEM_grow_clean(BUF_MEM *str, size_t len); 87 | size_t BUF_strnlen(const char *str, size_t maxlen); 88 | char *BUF_strdup(const char *str); 89 | 90 | /* 91 | * Like strndup, but in addition, explicitly guarantees to never read past the 92 | * first |siz| bytes of |str|. 93 | */ 94 | char *BUF_strndup(const char *str, size_t siz); 95 | 96 | void *BUF_memdup(const void *data, size_t siz); 97 | void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz); 98 | 99 | /* safe string functions */ 100 | size_t BUF_strlcpy(char *dst, const char *src, size_t siz); 101 | size_t BUF_strlcat(char *dst, const char *src, size_t siz); 102 | 103 | /* BEGIN ERROR CODES */ 104 | /* 105 | * The following lines are auto generated by the script mkerr.pl. Any changes 106 | * made after this point may be overwritten when the script is next run. 107 | */ 108 | void ERR_load_BUF_strings(void); 109 | 110 | /* Error codes for the BUF functions. */ 111 | 112 | /* Function codes. */ 113 | # define BUF_F_BUF_MEMDUP 103 114 | # define BUF_F_BUF_MEM_GROW 100 115 | # define BUF_F_BUF_MEM_GROW_CLEAN 105 116 | # define BUF_F_BUF_MEM_NEW 101 117 | # define BUF_F_BUF_STRDUP 102 118 | # define BUF_F_BUF_STRNDUP 104 119 | 120 | /* Reason codes. */ 121 | 122 | #ifdef __cplusplus 123 | } 124 | #endif 125 | #endif 126 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/camellia.h: -------------------------------------------------------------------------------- 1 | /* crypto/camellia/camellia.h */ 2 | /* ==================================================================== 3 | * Copyright (c) 2006 The OpenSSL Project. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in 14 | * the documentation and/or other materials provided with the 15 | * distribution. 16 | * 17 | * 3. All advertising materials mentioning features or use of this 18 | * software must display the following acknowledgment: 19 | * "This product includes software developed by the OpenSSL Project 20 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 21 | * 22 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 23 | * endorse or promote products derived from this software without 24 | * prior written permission. For written permission, please contact 25 | * openssl-core@openssl.org. 26 | * 27 | * 5. Products derived from this software may not be called "OpenSSL" 28 | * nor may "OpenSSL" appear in their names without prior written 29 | * permission of the OpenSSL Project. 30 | * 31 | * 6. Redistributions of any form whatsoever must retain the following 32 | * acknowledgment: 33 | * "This product includes software developed by the OpenSSL Project 34 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 35 | * 36 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 37 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 38 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 39 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 40 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 41 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 42 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 44 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 45 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 46 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 47 | * OF THE POSSIBILITY OF SUCH DAMAGE. 48 | * ==================================================================== 49 | * 50 | */ 51 | 52 | #ifndef HEADER_CAMELLIA_H 53 | # define HEADER_CAMELLIA_H 54 | 55 | # include 56 | 57 | # ifdef OPENSSL_NO_CAMELLIA 58 | # error CAMELLIA is disabled. 59 | # endif 60 | 61 | # include 62 | 63 | # define CAMELLIA_ENCRYPT 1 64 | # define CAMELLIA_DECRYPT 0 65 | 66 | /* 67 | * Because array size can't be a const in C, the following two are macros. 68 | * Both sizes are in bytes. 69 | */ 70 | 71 | #ifdef __cplusplus 72 | extern "C" { 73 | #endif 74 | 75 | /* This should be a hidden type, but EVP requires that the size be known */ 76 | 77 | # define CAMELLIA_BLOCK_SIZE 16 78 | # define CAMELLIA_TABLE_BYTE_LEN 272 79 | # define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4) 80 | 81 | typedef unsigned int KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN]; /* to match 82 | * with WORD */ 83 | 84 | struct camellia_key_st { 85 | union { 86 | double d; /* ensures 64-bit align */ 87 | KEY_TABLE_TYPE rd_key; 88 | } u; 89 | int grand_rounds; 90 | }; 91 | typedef struct camellia_key_st CAMELLIA_KEY; 92 | 93 | # ifdef OPENSSL_FIPS 94 | int private_Camellia_set_key(const unsigned char *userKey, const int bits, 95 | CAMELLIA_KEY *key); 96 | # endif 97 | int Camellia_set_key(const unsigned char *userKey, const int bits, 98 | CAMELLIA_KEY *key); 99 | 100 | void Camellia_encrypt(const unsigned char *in, unsigned char *out, 101 | const CAMELLIA_KEY *key); 102 | void Camellia_decrypt(const unsigned char *in, unsigned char *out, 103 | const CAMELLIA_KEY *key); 104 | 105 | void Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out, 106 | const CAMELLIA_KEY *key, const int enc); 107 | void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out, 108 | size_t length, const CAMELLIA_KEY *key, 109 | unsigned char *ivec, const int enc); 110 | void Camellia_cfb128_encrypt(const unsigned char *in, unsigned char *out, 111 | size_t length, const CAMELLIA_KEY *key, 112 | unsigned char *ivec, int *num, const int enc); 113 | void Camellia_cfb1_encrypt(const unsigned char *in, unsigned char *out, 114 | size_t length, const CAMELLIA_KEY *key, 115 | unsigned char *ivec, int *num, const int enc); 116 | void Camellia_cfb8_encrypt(const unsigned char *in, unsigned char *out, 117 | size_t length, const CAMELLIA_KEY *key, 118 | unsigned char *ivec, int *num, const int enc); 119 | void Camellia_ofb128_encrypt(const unsigned char *in, unsigned char *out, 120 | size_t length, const CAMELLIA_KEY *key, 121 | unsigned char *ivec, int *num); 122 | void Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out, 123 | size_t length, const CAMELLIA_KEY *key, 124 | unsigned char ivec[CAMELLIA_BLOCK_SIZE], 125 | unsigned char ecount_buf[CAMELLIA_BLOCK_SIZE], 126 | unsigned int *num); 127 | 128 | #ifdef __cplusplus 129 | } 130 | #endif 131 | 132 | #endif /* !HEADER_Camellia_H */ 133 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/cast.h: -------------------------------------------------------------------------------- 1 | /* crypto/cast/cast.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_CAST_H 60 | # define HEADER_CAST_H 61 | 62 | #ifdef __cplusplus 63 | extern "C" { 64 | #endif 65 | 66 | # include 67 | 68 | # ifdef OPENSSL_NO_CAST 69 | # error CAST is disabled. 70 | # endif 71 | 72 | # define CAST_ENCRYPT 1 73 | # define CAST_DECRYPT 0 74 | 75 | # define CAST_LONG unsigned int 76 | 77 | # define CAST_BLOCK 8 78 | # define CAST_KEY_LENGTH 16 79 | 80 | typedef struct cast_key_st { 81 | CAST_LONG data[32]; 82 | int short_key; /* Use reduced rounds for short key */ 83 | } CAST_KEY; 84 | 85 | # ifdef OPENSSL_FIPS 86 | void private_CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); 87 | # endif 88 | void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); 89 | void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out, 90 | const CAST_KEY *key, int enc); 91 | void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key); 92 | void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key); 93 | void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, 94 | long length, const CAST_KEY *ks, unsigned char *iv, 95 | int enc); 96 | void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, 97 | long length, const CAST_KEY *schedule, 98 | unsigned char *ivec, int *num, int enc); 99 | void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out, 100 | long length, const CAST_KEY *schedule, 101 | unsigned char *ivec, int *num); 102 | 103 | #ifdef __cplusplus 104 | } 105 | #endif 106 | 107 | #endif 108 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/cmac.h: -------------------------------------------------------------------------------- 1 | /* crypto/cmac/cmac.h */ 2 | /* 3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 4 | * project. 5 | */ 6 | /* ==================================================================== 7 | * Copyright (c) 2010 The OpenSSL Project. All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in 18 | * the documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * 3. All advertising materials mentioning features or use of this 22 | * software must display the following acknowledgment: 23 | * "This product includes software developed by the OpenSSL Project 24 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 25 | * 26 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 27 | * endorse or promote products derived from this software without 28 | * prior written permission. For written permission, please contact 29 | * licensing@OpenSSL.org. 30 | * 31 | * 5. Products derived from this software may not be called "OpenSSL" 32 | * nor may "OpenSSL" appear in their names without prior written 33 | * permission of the OpenSSL Project. 34 | * 35 | * 6. Redistributions of any form whatsoever must retain the following 36 | * acknowledgment: 37 | * "This product includes software developed by the OpenSSL Project 38 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 39 | * 40 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 41 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 43 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 44 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 46 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 47 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 49 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 50 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51 | * OF THE POSSIBILITY OF SUCH DAMAGE. 52 | * ==================================================================== 53 | */ 54 | 55 | #ifndef HEADER_CMAC_H 56 | # define HEADER_CMAC_H 57 | 58 | #ifdef __cplusplus 59 | extern "C" { 60 | #endif 61 | 62 | # include 63 | 64 | /* Opaque */ 65 | typedef struct CMAC_CTX_st CMAC_CTX; 66 | 67 | CMAC_CTX *CMAC_CTX_new(void); 68 | void CMAC_CTX_cleanup(CMAC_CTX *ctx); 69 | void CMAC_CTX_free(CMAC_CTX *ctx); 70 | EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx); 71 | int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in); 72 | 73 | int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen, 74 | const EVP_CIPHER *cipher, ENGINE *impl); 75 | int CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen); 76 | int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen); 77 | int CMAC_resume(CMAC_CTX *ctx); 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | #endif 83 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/comp.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef HEADER_COMP_H 3 | # define HEADER_COMP_H 4 | 5 | # include 6 | 7 | # ifdef OPENSSL_NO_COMP 8 | # error COMP is disabled. 9 | # endif 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef struct comp_ctx_st COMP_CTX; 16 | 17 | struct comp_method_st { 18 | int type; /* NID for compression library */ 19 | const char *name; /* A text string to identify the library */ 20 | int (*init) (COMP_CTX *ctx); 21 | void (*finish) (COMP_CTX *ctx); 22 | int (*compress) (COMP_CTX *ctx, 23 | unsigned char *out, unsigned int olen, 24 | unsigned char *in, unsigned int ilen); 25 | int (*expand) (COMP_CTX *ctx, 26 | unsigned char *out, unsigned int olen, 27 | unsigned char *in, unsigned int ilen); 28 | /* 29 | * The following two do NOTHING, but are kept for backward compatibility 30 | */ 31 | long (*ctrl) (void); 32 | long (*callback_ctrl) (void); 33 | }; 34 | 35 | struct comp_ctx_st { 36 | COMP_METHOD *meth; 37 | unsigned long compress_in; 38 | unsigned long compress_out; 39 | unsigned long expand_in; 40 | unsigned long expand_out; 41 | CRYPTO_EX_DATA ex_data; 42 | }; 43 | 44 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); 45 | void COMP_CTX_free(COMP_CTX *ctx); 46 | int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, 47 | unsigned char *in, int ilen); 48 | int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, 49 | unsigned char *in, int ilen); 50 | COMP_METHOD *COMP_rle(void); 51 | COMP_METHOD *COMP_zlib(void); 52 | void COMP_zlib_cleanup(void); 53 | 54 | # ifdef HEADER_BIO_H 55 | # ifdef ZLIB 56 | BIO_METHOD *BIO_f_zlib(void); 57 | # endif 58 | # endif 59 | 60 | /* BEGIN ERROR CODES */ 61 | /* 62 | * The following lines are auto generated by the script mkerr.pl. Any changes 63 | * made after this point may be overwritten when the script is next run. 64 | */ 65 | void ERR_load_COMP_strings(void); 66 | 67 | /* Error codes for the COMP functions. */ 68 | 69 | /* Function codes. */ 70 | # define COMP_F_BIO_ZLIB_FLUSH 99 71 | # define COMP_F_BIO_ZLIB_NEW 100 72 | # define COMP_F_BIO_ZLIB_READ 101 73 | # define COMP_F_BIO_ZLIB_WRITE 102 74 | 75 | /* Reason codes. */ 76 | # define COMP_R_ZLIB_DEFLATE_ERROR 99 77 | # define COMP_R_ZLIB_INFLATE_ERROR 100 78 | # define COMP_R_ZLIB_NOT_SUPPORTED 101 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | #endif 84 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/conf_api.h: -------------------------------------------------------------------------------- 1 | /* conf_api.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_CONF_API_H 60 | # define HEADER_CONF_API_H 61 | 62 | # include 63 | # include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | /* Up until OpenSSL 0.9.5a, this was new_section */ 70 | CONF_VALUE *_CONF_new_section(CONF *conf, const char *section); 71 | /* Up until OpenSSL 0.9.5a, this was get_section */ 72 | CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section); 73 | /* Up until OpenSSL 0.9.5a, this was CONF_get_section */ 74 | STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, 75 | const char *section); 76 | 77 | int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value); 78 | char *_CONF_get_string(const CONF *conf, const char *section, 79 | const char *name); 80 | long _CONF_get_number(const CONF *conf, const char *section, 81 | const char *name); 82 | 83 | int _CONF_new_data(CONF *conf); 84 | void _CONF_free_data(CONF *conf); 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | #endif 90 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/ebcdic.h: -------------------------------------------------------------------------------- 1 | /* crypto/ebcdic.h */ 2 | 3 | #ifndef HEADER_EBCDIC_H 4 | # define HEADER_EBCDIC_H 5 | 6 | # include 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | /* Avoid name clashes with other applications */ 13 | # define os_toascii _openssl_os_toascii 14 | # define os_toebcdic _openssl_os_toebcdic 15 | # define ebcdic2ascii _openssl_ebcdic2ascii 16 | # define ascii2ebcdic _openssl_ascii2ebcdic 17 | 18 | extern const unsigned char os_toascii[256]; 19 | extern const unsigned char os_toebcdic[256]; 20 | void *ebcdic2ascii(void *dest, const void *srce, size_t count); 21 | void *ascii2ebcdic(void *dest, const void *srce, size_t count); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | #endif 27 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/ecdh.h: -------------------------------------------------------------------------------- 1 | /* crypto/ecdh/ecdh.h */ 2 | /* ==================================================================== 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 4 | * 5 | * The Elliptic Curve Public-Key Crypto Library (ECC Code) included 6 | * herein is developed by SUN MICROSYSTEMS, INC., and is contributed 7 | * to the OpenSSL project. 8 | * 9 | * The ECC Code is licensed pursuant to the OpenSSL open source 10 | * license provided below. 11 | * 12 | * The ECDH software is originally written by Douglas Stebila of 13 | * Sun Microsystems Laboratories. 14 | * 15 | */ 16 | /* ==================================================================== 17 | * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. 18 | * 19 | * Redistribution and use in source and binary forms, with or without 20 | * modification, are permitted provided that the following conditions 21 | * are met: 22 | * 23 | * 1. Redistributions of source code must retain the above copyright 24 | * notice, this list of conditions and the following disclaimer. 25 | * 26 | * 2. Redistributions in binary form must reproduce the above copyright 27 | * notice, this list of conditions and the following disclaimer in 28 | * the documentation and/or other materials provided with the 29 | * distribution. 30 | * 31 | * 3. All advertising materials mentioning features or use of this 32 | * software must display the following acknowledgment: 33 | * "This product includes software developed by the OpenSSL Project 34 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 35 | * 36 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 37 | * endorse or promote products derived from this software without 38 | * prior written permission. For written permission, please contact 39 | * licensing@OpenSSL.org. 40 | * 41 | * 5. Products derived from this software may not be called "OpenSSL" 42 | * nor may "OpenSSL" appear in their names without prior written 43 | * permission of the OpenSSL Project. 44 | * 45 | * 6. Redistributions of any form whatsoever must retain the following 46 | * acknowledgment: 47 | * "This product includes software developed by the OpenSSL Project 48 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 49 | * 50 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 51 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 52 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 53 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 54 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 55 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 56 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 57 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 58 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 59 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 60 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 61 | * OF THE POSSIBILITY OF SUCH DAMAGE. 62 | * ==================================================================== 63 | * 64 | * This product includes cryptographic software written by Eric Young 65 | * (eay@cryptsoft.com). This product includes software written by Tim 66 | * Hudson (tjh@cryptsoft.com). 67 | * 68 | */ 69 | #ifndef HEADER_ECDH_H 70 | # define HEADER_ECDH_H 71 | 72 | # include 73 | 74 | # ifdef OPENSSL_NO_ECDH 75 | # error ECDH is disabled. 76 | # endif 77 | 78 | # include 79 | # include 80 | # ifndef OPENSSL_NO_DEPRECATED 81 | # include 82 | # endif 83 | 84 | #ifdef __cplusplus 85 | extern "C" { 86 | #endif 87 | 88 | # define EC_FLAG_COFACTOR_ECDH 0x1000 89 | 90 | const ECDH_METHOD *ECDH_OpenSSL(void); 91 | 92 | void ECDH_set_default_method(const ECDH_METHOD *); 93 | const ECDH_METHOD *ECDH_get_default_method(void); 94 | int ECDH_set_method(EC_KEY *, const ECDH_METHOD *); 95 | 96 | int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, 97 | EC_KEY *ecdh, void *(*KDF) (const void *in, size_t inlen, 98 | void *out, size_t *outlen)); 99 | 100 | int ECDH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new 101 | *new_func, CRYPTO_EX_dup *dup_func, 102 | CRYPTO_EX_free *free_func); 103 | int ECDH_set_ex_data(EC_KEY *d, int idx, void *arg); 104 | void *ECDH_get_ex_data(EC_KEY *d, int idx); 105 | 106 | int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, 107 | const unsigned char *Z, size_t Zlen, 108 | const unsigned char *sinfo, size_t sinfolen, 109 | const EVP_MD *md); 110 | 111 | /* BEGIN ERROR CODES */ 112 | /* 113 | * The following lines are auto generated by the script mkerr.pl. Any changes 114 | * made after this point may be overwritten when the script is next run. 115 | */ 116 | void ERR_load_ECDH_strings(void); 117 | 118 | /* Error codes for the ECDH functions. */ 119 | 120 | /* Function codes. */ 121 | # define ECDH_F_ECDH_CHECK 102 122 | # define ECDH_F_ECDH_COMPUTE_KEY 100 123 | # define ECDH_F_ECDH_DATA_NEW_METHOD 101 124 | 125 | /* Reason codes. */ 126 | # define ECDH_R_KDF_FAILED 102 127 | # define ECDH_R_NON_FIPS_METHOD 103 128 | # define ECDH_R_NO_PRIVATE_VALUE 100 129 | # define ECDH_R_POINT_ARITHMETIC_FAILURE 101 130 | 131 | #ifdef __cplusplus 132 | } 133 | #endif 134 | #endif 135 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/hmac.h: -------------------------------------------------------------------------------- 1 | /* crypto/hmac/hmac.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | #ifndef HEADER_HMAC_H 59 | # define HEADER_HMAC_H 60 | 61 | # include 62 | 63 | # ifdef OPENSSL_NO_HMAC 64 | # error HMAC is disabled. 65 | # endif 66 | 67 | # include 68 | 69 | # define HMAC_MAX_MD_CBLOCK 128/* largest known is SHA512 */ 70 | 71 | #ifdef __cplusplus 72 | extern "C" { 73 | #endif 74 | 75 | typedef struct hmac_ctx_st { 76 | const EVP_MD *md; 77 | EVP_MD_CTX md_ctx; 78 | EVP_MD_CTX i_ctx; 79 | EVP_MD_CTX o_ctx; 80 | unsigned int key_length; 81 | unsigned char key[HMAC_MAX_MD_CBLOCK]; 82 | } HMAC_CTX; 83 | 84 | # define HMAC_size(e) (EVP_MD_size((e)->md)) 85 | 86 | void HMAC_CTX_init(HMAC_CTX *ctx); 87 | void HMAC_CTX_cleanup(HMAC_CTX *ctx); 88 | 89 | /* deprecated */ 90 | # define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx) 91 | 92 | /* deprecated */ 93 | int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md); 94 | int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, 95 | const EVP_MD *md, ENGINE *impl); 96 | int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len); 97 | int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); 98 | unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, 99 | const unsigned char *d, size_t n, unsigned char *md, 100 | unsigned int *md_len); 101 | int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx); 102 | 103 | void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags); 104 | 105 | #ifdef __cplusplus 106 | } 107 | #endif 108 | 109 | #endif 110 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/idea.h: -------------------------------------------------------------------------------- 1 | /* crypto/idea/idea.h */ 2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_IDEA_H 60 | # define HEADER_IDEA_H 61 | 62 | # include /* IDEA_INT, OPENSSL_NO_IDEA */ 63 | 64 | # ifdef OPENSSL_NO_IDEA 65 | # error IDEA is disabled. 66 | # endif 67 | 68 | # define IDEA_ENCRYPT 1 69 | # define IDEA_DECRYPT 0 70 | 71 | # define IDEA_BLOCK 8 72 | # define IDEA_KEY_LENGTH 16 73 | 74 | #ifdef __cplusplus 75 | extern "C" { 76 | #endif 77 | 78 | typedef struct idea_key_st { 79 | IDEA_INT data[9][6]; 80 | } IDEA_KEY_SCHEDULE; 81 | 82 | const char *idea_options(void); 83 | void idea_ecb_encrypt(const unsigned char *in, unsigned char *out, 84 | IDEA_KEY_SCHEDULE *ks); 85 | # ifdef OPENSSL_FIPS 86 | void private_idea_set_encrypt_key(const unsigned char *key, 87 | IDEA_KEY_SCHEDULE *ks); 88 | # endif 89 | void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks); 90 | void idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk); 91 | void idea_cbc_encrypt(const unsigned char *in, unsigned char *out, 92 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, 93 | int enc); 94 | void idea_cfb64_encrypt(const unsigned char *in, unsigned char *out, 95 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, 96 | int *num, int enc); 97 | void idea_ofb64_encrypt(const unsigned char *in, unsigned char *out, 98 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, 99 | int *num); 100 | void idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks); 101 | #ifdef __cplusplus 102 | } 103 | #endif 104 | 105 | #endif 106 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/kssl.h: -------------------------------------------------------------------------------- 1 | /* ssl/kssl.h */ 2 | /* 3 | * Written by Vern Staats for the OpenSSL project 4 | * 2000. project 2000. 5 | */ 6 | /* ==================================================================== 7 | * Copyright (c) 2000 The OpenSSL Project. All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in 18 | * the documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * 3. All advertising materials mentioning features or use of this 22 | * software must display the following acknowledgment: 23 | * "This product includes software developed by the OpenSSL Project 24 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 25 | * 26 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 27 | * endorse or promote products derived from this software without 28 | * prior written permission. For written permission, please contact 29 | * licensing@OpenSSL.org. 30 | * 31 | * 5. Products derived from this software may not be called "OpenSSL" 32 | * nor may "OpenSSL" appear in their names without prior written 33 | * permission of the OpenSSL Project. 34 | * 35 | * 6. Redistributions of any form whatsoever must retain the following 36 | * acknowledgment: 37 | * "This product includes software developed by the OpenSSL Project 38 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 39 | * 40 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 41 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 43 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 44 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 46 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 47 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 49 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 50 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51 | * OF THE POSSIBILITY OF SUCH DAMAGE. 52 | * ==================================================================== 53 | * 54 | * This product includes cryptographic software written by Eric Young 55 | * (eay@cryptsoft.com). This product includes software written by Tim 56 | * Hudson (tjh@cryptsoft.com). 57 | * 58 | */ 59 | 60 | /* 61 | ** 19990701 VRS Started. 62 | */ 63 | 64 | #ifndef KSSL_H 65 | # define KSSL_H 66 | 67 | # include 68 | 69 | # ifndef OPENSSL_NO_KRB5 70 | 71 | # include 72 | # include 73 | # include 74 | # ifdef OPENSSL_SYS_WIN32 75 | /* 76 | * These can sometimes get redefined indirectly by krb5 header files after 77 | * they get undefed in ossl_typ.h 78 | */ 79 | # undef X509_NAME 80 | # undef X509_EXTENSIONS 81 | # undef OCSP_REQUEST 82 | # undef OCSP_RESPONSE 83 | # endif 84 | 85 | #ifdef __cplusplus 86 | extern "C" { 87 | #endif 88 | 89 | /* 90 | * Depending on which KRB5 implementation used, some types from 91 | * the other may be missing. Resolve that here and now 92 | */ 93 | # ifdef KRB5_HEIMDAL 94 | typedef unsigned char krb5_octet; 95 | # define FAR 96 | # else 97 | 98 | # ifndef FAR 99 | # define FAR 100 | # endif 101 | 102 | # endif 103 | 104 | /*- 105 | * Uncomment this to debug kssl problems or 106 | * to trace usage of the Kerberos session key 107 | * 108 | * #define KSSL_DEBUG 109 | */ 110 | 111 | # ifndef KRB5SVC 112 | # define KRB5SVC "host" 113 | # endif 114 | 115 | # ifndef KRB5KEYTAB 116 | # define KRB5KEYTAB "/etc/krb5.keytab" 117 | # endif 118 | 119 | # ifndef KRB5SENDAUTH 120 | # define KRB5SENDAUTH 1 121 | # endif 122 | 123 | # ifndef KRB5CHECKAUTH 124 | # define KRB5CHECKAUTH 1 125 | # endif 126 | 127 | # ifndef KSSL_CLOCKSKEW 128 | # define KSSL_CLOCKSKEW 300; 129 | # endif 130 | 131 | # define KSSL_ERR_MAX 255 132 | typedef struct kssl_err_st { 133 | int reason; 134 | char text[KSSL_ERR_MAX + 1]; 135 | } KSSL_ERR; 136 | 137 | /*- Context for passing 138 | * (1) Kerberos session key to SSL, and 139 | * (2) Config data between application and SSL lib 140 | */ 141 | typedef struct kssl_ctx_st { 142 | /* used by: disposition: */ 143 | char *service_name; /* C,S default ok (kssl) */ 144 | char *service_host; /* C input, REQUIRED */ 145 | char *client_princ; /* S output from krb5 ticket */ 146 | char *keytab_file; /* S NULL (/etc/krb5.keytab) */ 147 | char *cred_cache; /* C NULL (default) */ 148 | krb5_enctype enctype; 149 | int length; 150 | krb5_octet FAR *key; 151 | } KSSL_CTX; 152 | 153 | # define KSSL_CLIENT 1 154 | # define KSSL_SERVER 2 155 | # define KSSL_SERVICE 3 156 | # define KSSL_KEYTAB 4 157 | 158 | # define KSSL_CTX_OK 0 159 | # define KSSL_CTX_ERR 1 160 | # define KSSL_NOMEM 2 161 | 162 | /* Public (for use by applications that use OpenSSL with Kerberos 5 support */ 163 | krb5_error_code kssl_ctx_setstring(KSSL_CTX *kssl_ctx, int which, char *text); 164 | KSSL_CTX *kssl_ctx_new(void); 165 | KSSL_CTX *kssl_ctx_free(KSSL_CTX *kssl_ctx); 166 | void kssl_ctx_show(KSSL_CTX *kssl_ctx); 167 | krb5_error_code kssl_ctx_setprinc(KSSL_CTX *kssl_ctx, int which, 168 | krb5_data *realm, krb5_data *entity, 169 | int nentities); 170 | krb5_error_code kssl_cget_tkt(KSSL_CTX *kssl_ctx, krb5_data **enc_tktp, 171 | krb5_data *authenp, KSSL_ERR *kssl_err); 172 | krb5_error_code kssl_sget_tkt(KSSL_CTX *kssl_ctx, krb5_data *indata, 173 | krb5_ticket_times *ttimes, KSSL_ERR *kssl_err); 174 | krb5_error_code kssl_ctx_setkey(KSSL_CTX *kssl_ctx, krb5_keyblock *session); 175 | void kssl_err_set(KSSL_ERR *kssl_err, int reason, char *text); 176 | void kssl_krb5_free_data_contents(krb5_context context, krb5_data *data); 177 | krb5_error_code kssl_build_principal_2(krb5_context context, 178 | krb5_principal *princ, int rlen, 179 | const char *realm, int slen, 180 | const char *svc, int hlen, 181 | const char *host); 182 | krb5_error_code kssl_validate_times(krb5_timestamp atime, 183 | krb5_ticket_times *ttimes); 184 | krb5_error_code kssl_check_authent(KSSL_CTX *kssl_ctx, krb5_data *authentp, 185 | krb5_timestamp *atimep, 186 | KSSL_ERR *kssl_err); 187 | unsigned char *kssl_skip_confound(krb5_enctype enctype, unsigned char *authn); 188 | 189 | void SSL_set0_kssl_ctx(SSL *s, KSSL_CTX *kctx); 190 | KSSL_CTX *SSL_get0_kssl_ctx(SSL *s); 191 | char *kssl_ctx_get0_client_princ(KSSL_CTX *kctx); 192 | 193 | #ifdef __cplusplus 194 | } 195 | #endif 196 | # endif /* OPENSSL_NO_KRB5 */ 197 | #endif /* KSSL_H */ 198 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/md4.h: -------------------------------------------------------------------------------- 1 | /* crypto/md4/md4.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_MD4_H 60 | # define HEADER_MD4_H 61 | 62 | # include 63 | # include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | # ifdef OPENSSL_NO_MD4 70 | # error MD4 is disabled. 71 | # endif 72 | 73 | /*- 74 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 75 | * ! MD4_LONG has to be at least 32 bits wide. If it's wider, then ! 76 | * ! MD4_LONG_LOG2 has to be defined along. ! 77 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 78 | */ 79 | 80 | # if defined(__LP32__) 81 | # define MD4_LONG unsigned long 82 | # elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) 83 | # define MD4_LONG unsigned long 84 | # define MD4_LONG_LOG2 3 85 | /* 86 | * _CRAY note. I could declare short, but I have no idea what impact 87 | * does it have on performance on none-T3E machines. I could declare 88 | * int, but at least on C90 sizeof(int) can be chosen at compile time. 89 | * So I've chosen long... 90 | * 91 | */ 92 | # else 93 | # define MD4_LONG unsigned int 94 | # endif 95 | 96 | # define MD4_CBLOCK 64 97 | # define MD4_LBLOCK (MD4_CBLOCK/4) 98 | # define MD4_DIGEST_LENGTH 16 99 | 100 | typedef struct MD4state_st { 101 | MD4_LONG A, B, C, D; 102 | MD4_LONG Nl, Nh; 103 | MD4_LONG data[MD4_LBLOCK]; 104 | unsigned int num; 105 | } MD4_CTX; 106 | 107 | # ifdef OPENSSL_FIPS 108 | int private_MD4_Init(MD4_CTX *c); 109 | # endif 110 | int MD4_Init(MD4_CTX *c); 111 | int MD4_Update(MD4_CTX *c, const void *data, size_t len); 112 | int MD4_Final(unsigned char *md, MD4_CTX *c); 113 | unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md); 114 | void MD4_Transform(MD4_CTX *c, const unsigned char *b); 115 | #ifdef __cplusplus 116 | } 117 | #endif 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/md5.h: -------------------------------------------------------------------------------- 1 | /* crypto/md5/md5.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_MD5_H 60 | # define HEADER_MD5_H 61 | 62 | # include 63 | # include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | # ifdef OPENSSL_NO_MD5 70 | # error MD5 is disabled. 71 | # endif 72 | 73 | /* 74 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 75 | * ! MD5_LONG has to be at least 32 bits wide. If it's wider, then ! 76 | * ! MD5_LONG_LOG2 has to be defined along. ! 77 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 78 | */ 79 | 80 | # if defined(__LP32__) 81 | # define MD5_LONG unsigned long 82 | # elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) 83 | # define MD5_LONG unsigned long 84 | # define MD5_LONG_LOG2 3 85 | /* 86 | * _CRAY note. I could declare short, but I have no idea what impact 87 | * does it have on performance on none-T3E machines. I could declare 88 | * int, but at least on C90 sizeof(int) can be chosen at compile time. 89 | * So I've chosen long... 90 | * 91 | */ 92 | # else 93 | # define MD5_LONG unsigned int 94 | # endif 95 | 96 | # define MD5_CBLOCK 64 97 | # define MD5_LBLOCK (MD5_CBLOCK/4) 98 | # define MD5_DIGEST_LENGTH 16 99 | 100 | typedef struct MD5state_st { 101 | MD5_LONG A, B, C, D; 102 | MD5_LONG Nl, Nh; 103 | MD5_LONG data[MD5_LBLOCK]; 104 | unsigned int num; 105 | } MD5_CTX; 106 | 107 | # ifdef OPENSSL_FIPS 108 | int private_MD5_Init(MD5_CTX *c); 109 | # endif 110 | int MD5_Init(MD5_CTX *c); 111 | int MD5_Update(MD5_CTX *c, const void *data, size_t len); 112 | int MD5_Final(unsigned char *md, MD5_CTX *c); 113 | unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md); 114 | void MD5_Transform(MD5_CTX *c, const unsigned char *b); 115 | #ifdef __cplusplus 116 | } 117 | #endif 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/mdc2.h: -------------------------------------------------------------------------------- 1 | /* crypto/mdc2/mdc2.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_MDC2_H 60 | # define HEADER_MDC2_H 61 | 62 | # include 63 | 64 | #ifdef __cplusplus 65 | extern "C" { 66 | #endif 67 | 68 | # ifdef OPENSSL_NO_MDC2 69 | # error MDC2 is disabled. 70 | # endif 71 | 72 | # define MDC2_BLOCK 8 73 | # define MDC2_DIGEST_LENGTH 16 74 | 75 | typedef struct mdc2_ctx_st { 76 | unsigned int num; 77 | unsigned char data[MDC2_BLOCK]; 78 | DES_cblock h, hh; 79 | int pad_type; /* either 1 or 2, default 1 */ 80 | } MDC2_CTX; 81 | 82 | # ifdef OPENSSL_FIPS 83 | int private_MDC2_Init(MDC2_CTX *c); 84 | # endif 85 | int MDC2_Init(MDC2_CTX *c); 86 | int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len); 87 | int MDC2_Final(unsigned char *md, MDC2_CTX *c); 88 | unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md); 89 | 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/opensslconf.h: -------------------------------------------------------------------------------- 1 | /* opensslconf.h */ 2 | /* WARNING: Generated automatically from opensslconf.h.in by Configure. */ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | /* OpenSSL was configured with the following options: */ 8 | #ifndef OPENSSL_SYSNAME_MINGW64 9 | # define OPENSSL_SYSNAME_MINGW64 10 | #endif 11 | #ifndef OPENSSL_DOING_MAKEDEPEND 12 | 13 | 14 | #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 15 | # define OPENSSL_NO_EC_NISTP_64_GCC_128 16 | #endif 17 | #ifndef OPENSSL_NO_GMP 18 | # define OPENSSL_NO_GMP 19 | #endif 20 | #ifndef OPENSSL_NO_JPAKE 21 | # define OPENSSL_NO_JPAKE 22 | #endif 23 | #ifndef OPENSSL_NO_KRB5 24 | # define OPENSSL_NO_KRB5 25 | #endif 26 | #ifndef OPENSSL_NO_LIBUNBOUND 27 | # define OPENSSL_NO_LIBUNBOUND 28 | #endif 29 | #ifndef OPENSSL_NO_MD2 30 | # define OPENSSL_NO_MD2 31 | #endif 32 | #ifndef OPENSSL_NO_RC5 33 | # define OPENSSL_NO_RC5 34 | #endif 35 | #ifndef OPENSSL_NO_RFC3779 36 | # define OPENSSL_NO_RFC3779 37 | #endif 38 | #ifndef OPENSSL_NO_SCTP 39 | # define OPENSSL_NO_SCTP 40 | #endif 41 | #ifndef OPENSSL_NO_SSL_TRACE 42 | # define OPENSSL_NO_SSL_TRACE 43 | #endif 44 | #ifndef OPENSSL_NO_SSL2 45 | # define OPENSSL_NO_SSL2 46 | #endif 47 | #ifndef OPENSSL_NO_STORE 48 | # define OPENSSL_NO_STORE 49 | #endif 50 | #ifndef OPENSSL_NO_UNIT_TEST 51 | # define OPENSSL_NO_UNIT_TEST 52 | #endif 53 | #ifndef OPENSSL_NO_WEAK_SSL_CIPHERS 54 | # define OPENSSL_NO_WEAK_SSL_CIPHERS 55 | #endif 56 | 57 | #endif /* OPENSSL_DOING_MAKEDEPEND */ 58 | 59 | #ifndef OPENSSL_THREADS 60 | # define OPENSSL_THREADS 61 | #endif 62 | #ifndef OPENSSL_NO_DYNAMIC_ENGINE 63 | # define OPENSSL_NO_DYNAMIC_ENGINE 64 | #endif 65 | 66 | /* The OPENSSL_NO_* macros are also defined as NO_* if the application 67 | asks for it. This is a transient feature that is provided for those 68 | who haven't had the time to do the appropriate changes in their 69 | applications. */ 70 | #ifdef OPENSSL_ALGORITHM_DEFINES 71 | # if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128) 72 | # define NO_EC_NISTP_64_GCC_128 73 | # endif 74 | # if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) 75 | # define NO_GMP 76 | # endif 77 | # if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE) 78 | # define NO_JPAKE 79 | # endif 80 | # if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5) 81 | # define NO_KRB5 82 | # endif 83 | # if defined(OPENSSL_NO_LIBUNBOUND) && !defined(NO_LIBUNBOUND) 84 | # define NO_LIBUNBOUND 85 | # endif 86 | # if defined(OPENSSL_NO_MD2) && !defined(NO_MD2) 87 | # define NO_MD2 88 | # endif 89 | # if defined(OPENSSL_NO_RC5) && !defined(NO_RC5) 90 | # define NO_RC5 91 | # endif 92 | # if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779) 93 | # define NO_RFC3779 94 | # endif 95 | # if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) 96 | # define NO_SCTP 97 | # endif 98 | # if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) 99 | # define NO_SSL_TRACE 100 | # endif 101 | # if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) 102 | # define NO_SSL2 103 | # endif 104 | # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) 105 | # define NO_STORE 106 | # endif 107 | # if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) 108 | # define NO_UNIT_TEST 109 | # endif 110 | # if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) 111 | # define NO_WEAK_SSL_CIPHERS 112 | # endif 113 | #endif 114 | 115 | #define OPENSSL_CPUID_OBJ 116 | 117 | /* crypto/opensslconf.h.in */ 118 | 119 | /* Generate 80386 code? */ 120 | #undef I386_ONLY 121 | 122 | #if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ 123 | #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) 124 | #define ENGINESDIR "/mingw64/lib/engines" 125 | #define OPENSSLDIR "/mingw64/ssl" 126 | #endif 127 | #endif 128 | 129 | #undef OPENSSL_UNISTD 130 | #define OPENSSL_UNISTD 131 | 132 | #undef OPENSSL_EXPORT_VAR_AS_FUNCTION 133 | #define OPENSSL_EXPORT_VAR_AS_FUNCTION 134 | 135 | #if defined(HEADER_IDEA_H) && !defined(IDEA_INT) 136 | #define IDEA_INT unsigned int 137 | #endif 138 | 139 | #if defined(HEADER_MD2_H) && !defined(MD2_INT) 140 | #define MD2_INT unsigned int 141 | #endif 142 | 143 | #if defined(HEADER_RC2_H) && !defined(RC2_INT) 144 | /* I need to put in a mod for the alpha - eay */ 145 | #define RC2_INT unsigned int 146 | #endif 147 | 148 | #if defined(HEADER_RC4_H) 149 | #if !defined(RC4_INT) 150 | /* using int types make the structure larger but make the code faster 151 | * on most boxes I have tested - up to %20 faster. */ 152 | /* 153 | * I don't know what does "most" mean, but declaring "int" is a must on: 154 | * - Intel P6 because partial register stalls are very expensive; 155 | * - elder Alpha because it lacks byte load/store instructions; 156 | */ 157 | #define RC4_INT unsigned int 158 | #endif 159 | #if !defined(RC4_CHUNK) 160 | /* 161 | * This enables code handling data aligned at natural CPU word 162 | * boundary. See crypto/rc4/rc4_enc.c for further details. 163 | */ 164 | #define RC4_CHUNK unsigned long long 165 | #endif 166 | #endif 167 | 168 | #if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG) 169 | /* If this is set to 'unsigned int' on a DEC Alpha, this gives about a 170 | * %20 speed up (longs are 8 bytes, int's are 4). */ 171 | #ifndef DES_LONG 172 | #define DES_LONG unsigned int 173 | #endif 174 | #endif 175 | 176 | #if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) 177 | #define CONFIG_HEADER_BN_H 178 | #undef BN_LLONG 179 | 180 | /* Should we define BN_DIV2W here? */ 181 | 182 | /* Only one for the following should be defined */ 183 | #undef SIXTY_FOUR_BIT_LONG 184 | #define SIXTY_FOUR_BIT 185 | #undef THIRTY_TWO_BIT 186 | #endif 187 | 188 | #if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) 189 | #define CONFIG_HEADER_RC4_LOCL_H 190 | /* if this is defined data[i] is used instead of *data, this is a %20 191 | * speedup on x86 */ 192 | #undef RC4_INDEX 193 | #endif 194 | 195 | #if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) 196 | #define CONFIG_HEADER_BF_LOCL_H 197 | #undef BF_PTR 198 | #endif /* HEADER_BF_LOCL_H */ 199 | 200 | #if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) 201 | #define CONFIG_HEADER_DES_LOCL_H 202 | #ifndef DES_DEFAULT_OPTIONS 203 | /* the following is tweaked from a config script, that is why it is a 204 | * protected undef/define */ 205 | #ifndef DES_PTR 206 | #undef DES_PTR 207 | #endif 208 | 209 | /* This helps C compiler generate the correct code for multiple functional 210 | * units. It reduces register dependancies at the expense of 2 more 211 | * registers */ 212 | #ifndef DES_RISC1 213 | #undef DES_RISC1 214 | #endif 215 | 216 | #ifndef DES_RISC2 217 | #undef DES_RISC2 218 | #endif 219 | 220 | #if defined(DES_RISC1) && defined(DES_RISC2) 221 | #error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! 222 | #endif 223 | 224 | /* Unroll the inner loop, this sometimes helps, sometimes hinders. 225 | * Very mucy CPU dependant */ 226 | #ifndef DES_UNROLL 227 | #undef DES_UNROLL 228 | #endif 229 | 230 | /* These default values were supplied by 231 | * Peter Gutman 232 | * They are only used if nothing else has been defined */ 233 | #if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL) 234 | /* Special defines which change the way the code is built depending on the 235 | CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find 236 | even newer MIPS CPU's, but at the moment one size fits all for 237 | optimization options. Older Sparc's work better with only UNROLL, but 238 | there's no way to tell at compile time what it is you're running on */ 239 | 240 | #if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ 241 | # define DES_PTR 242 | # define DES_RISC1 243 | # define DES_UNROLL 244 | #elif defined( __ultrix ) /* Older MIPS */ 245 | # define DES_PTR 246 | # define DES_RISC2 247 | # define DES_UNROLL 248 | #elif defined( __osf1__ ) /* Alpha */ 249 | # define DES_PTR 250 | # define DES_RISC2 251 | #elif defined ( _AIX ) /* RS6000 */ 252 | /* Unknown */ 253 | #elif defined( __hpux ) /* HP-PA */ 254 | /* Unknown */ 255 | #elif defined( __aux ) /* 68K */ 256 | /* Unknown */ 257 | #elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ 258 | # define DES_UNROLL 259 | #elif defined( __sgi ) /* Newer MIPS */ 260 | # define DES_PTR 261 | # define DES_RISC2 262 | # define DES_UNROLL 263 | #elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */ 264 | # define DES_PTR 265 | # define DES_RISC1 266 | # define DES_UNROLL 267 | #endif /* Systems-specific speed defines */ 268 | #endif 269 | 270 | #endif /* DES_DEFAULT_OPTIONS */ 271 | #endif /* HEADER_DES_LOCL_H */ 272 | #ifdef __cplusplus 273 | } 274 | #endif 275 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/opensslv.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_OPENSSLV_H 2 | # define HEADER_OPENSSLV_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /*- 9 | * Numeric release version identifier: 10 | * MNNFFPPS: major minor fix patch status 11 | * The status nibble has one of the values 0 for development, 1 to e for betas 12 | * 1 to 14, and f for release. The patch level is exactly that. 13 | * For example: 14 | * 0.9.3-dev 0x00903000 15 | * 0.9.3-beta1 0x00903001 16 | * 0.9.3-beta2-dev 0x00903002 17 | * 0.9.3-beta2 0x00903002 (same as ...beta2-dev) 18 | * 0.9.3 0x0090300f 19 | * 0.9.3a 0x0090301f 20 | * 0.9.4 0x0090400f 21 | * 1.2.3z 0x102031af 22 | * 23 | * For continuity reasons (because 0.9.5 is already out, and is coded 24 | * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level 25 | * part is slightly different, by setting the highest bit. This means 26 | * that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start 27 | * with 0x0090600S... 28 | * 29 | * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.) 30 | * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for 31 | * major minor fix final patch/beta) 32 | */ 33 | # define OPENSSL_VERSION_NUMBER 0x1000212fL 34 | # ifdef OPENSSL_FIPS 35 | # define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2r-fips 26 Feb 2019" 36 | # else 37 | # define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2r 26 Feb 2019" 38 | # endif 39 | # define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT 40 | 41 | /*- 42 | * The macros below are to be used for shared library (.so, .dll, ...) 43 | * versioning. That kind of versioning works a bit differently between 44 | * operating systems. The most usual scheme is to set a major and a minor 45 | * number, and have the runtime loader check that the major number is equal 46 | * to what it was at application link time, while the minor number has to 47 | * be greater or equal to what it was at application link time. With this 48 | * scheme, the version number is usually part of the file name, like this: 49 | * 50 | * libcrypto.so.0.9 51 | * 52 | * Some unixen also make a softlink with the major verson number only: 53 | * 54 | * libcrypto.so.0 55 | * 56 | * On Tru64 and IRIX 6.x it works a little bit differently. There, the 57 | * shared library version is stored in the file, and is actually a series 58 | * of versions, separated by colons. The rightmost version present in the 59 | * library when linking an application is stored in the application to be 60 | * matched at run time. When the application is run, a check is done to 61 | * see if the library version stored in the application matches any of the 62 | * versions in the version string of the library itself. 63 | * This version string can be constructed in any way, depending on what 64 | * kind of matching is desired. However, to implement the same scheme as 65 | * the one used in the other unixen, all compatible versions, from lowest 66 | * to highest, should be part of the string. Consecutive builds would 67 | * give the following versions strings: 68 | * 69 | * 3.0 70 | * 3.0:3.1 71 | * 3.0:3.1:3.2 72 | * 4.0 73 | * 4.0:4.1 74 | * 75 | * Notice how version 4 is completely incompatible with version, and 76 | * therefore give the breach you can see. 77 | * 78 | * There may be other schemes as well that I haven't yet discovered. 79 | * 80 | * So, here's the way it works here: first of all, the library version 81 | * number doesn't need at all to match the overall OpenSSL version. 82 | * However, it's nice and more understandable if it actually does. 83 | * The current library version is stored in the macro SHLIB_VERSION_NUMBER, 84 | * which is just a piece of text in the format "M.m.e" (Major, minor, edit). 85 | * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways, 86 | * we need to keep a history of version numbers, which is done in the 87 | * macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and 88 | * should only keep the versions that are binary compatible with the current. 89 | */ 90 | # define SHLIB_VERSION_HISTORY "" 91 | # define SHLIB_VERSION_NUMBER "1.0.0" 92 | 93 | 94 | #ifdef __cplusplus 95 | } 96 | #endif 97 | #endif /* HEADER_OPENSSLV_H */ 98 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/ossl_typ.h: -------------------------------------------------------------------------------- 1 | /* ==================================================================== 2 | * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * 3. All advertising materials mentioning features or use of this 17 | * software must display the following acknowledgment: 18 | * "This product includes software developed by the OpenSSL Project 19 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 20 | * 21 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 22 | * endorse or promote products derived from this software without 23 | * prior written permission. For written permission, please contact 24 | * openssl-core@openssl.org. 25 | * 26 | * 5. Products derived from this software may not be called "OpenSSL" 27 | * nor may "OpenSSL" appear in their names without prior written 28 | * permission of the OpenSSL Project. 29 | * 30 | * 6. Redistributions of any form whatsoever must retain the following 31 | * acknowledgment: 32 | * "This product includes software developed by the OpenSSL Project 33 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 34 | * 35 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 36 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 37 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 38 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 39 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 40 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 41 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 42 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 43 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 44 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 45 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 46 | * OF THE POSSIBILITY OF SUCH DAMAGE. 47 | * ==================================================================== 48 | * 49 | * This product includes cryptographic software written by Eric Young 50 | * (eay@cryptsoft.com). This product includes software written by Tim 51 | * Hudson (tjh@cryptsoft.com). 52 | * 53 | */ 54 | 55 | #ifndef HEADER_OPENSSL_TYPES_H 56 | # define HEADER_OPENSSL_TYPES_H 57 | 58 | #ifdef __cplusplus 59 | extern "C" { 60 | #endif 61 | 62 | # include 63 | 64 | # ifdef NO_ASN1_TYPEDEFS 65 | # define ASN1_INTEGER ASN1_STRING 66 | # define ASN1_ENUMERATED ASN1_STRING 67 | # define ASN1_BIT_STRING ASN1_STRING 68 | # define ASN1_OCTET_STRING ASN1_STRING 69 | # define ASN1_PRINTABLESTRING ASN1_STRING 70 | # define ASN1_T61STRING ASN1_STRING 71 | # define ASN1_IA5STRING ASN1_STRING 72 | # define ASN1_UTCTIME ASN1_STRING 73 | # define ASN1_GENERALIZEDTIME ASN1_STRING 74 | # define ASN1_TIME ASN1_STRING 75 | # define ASN1_GENERALSTRING ASN1_STRING 76 | # define ASN1_UNIVERSALSTRING ASN1_STRING 77 | # define ASN1_BMPSTRING ASN1_STRING 78 | # define ASN1_VISIBLESTRING ASN1_STRING 79 | # define ASN1_UTF8STRING ASN1_STRING 80 | # define ASN1_BOOLEAN int 81 | # define ASN1_NULL int 82 | # else 83 | typedef struct asn1_string_st ASN1_INTEGER; 84 | typedef struct asn1_string_st ASN1_ENUMERATED; 85 | typedef struct asn1_string_st ASN1_BIT_STRING; 86 | typedef struct asn1_string_st ASN1_OCTET_STRING; 87 | typedef struct asn1_string_st ASN1_PRINTABLESTRING; 88 | typedef struct asn1_string_st ASN1_T61STRING; 89 | typedef struct asn1_string_st ASN1_IA5STRING; 90 | typedef struct asn1_string_st ASN1_GENERALSTRING; 91 | typedef struct asn1_string_st ASN1_UNIVERSALSTRING; 92 | typedef struct asn1_string_st ASN1_BMPSTRING; 93 | typedef struct asn1_string_st ASN1_UTCTIME; 94 | typedef struct asn1_string_st ASN1_TIME; 95 | typedef struct asn1_string_st ASN1_GENERALIZEDTIME; 96 | typedef struct asn1_string_st ASN1_VISIBLESTRING; 97 | typedef struct asn1_string_st ASN1_UTF8STRING; 98 | typedef struct asn1_string_st ASN1_STRING; 99 | typedef int ASN1_BOOLEAN; 100 | typedef int ASN1_NULL; 101 | # endif 102 | 103 | typedef struct asn1_object_st ASN1_OBJECT; 104 | 105 | typedef struct ASN1_ITEM_st ASN1_ITEM; 106 | typedef struct asn1_pctx_st ASN1_PCTX; 107 | 108 | # ifdef OPENSSL_SYS_WIN32 109 | # undef X509_NAME 110 | # undef X509_EXTENSIONS 111 | # undef X509_CERT_PAIR 112 | # undef PKCS7_ISSUER_AND_SERIAL 113 | # undef OCSP_REQUEST 114 | # undef OCSP_RESPONSE 115 | # endif 116 | 117 | # ifdef BIGNUM 118 | # undef BIGNUM 119 | # endif 120 | typedef struct bignum_st BIGNUM; 121 | typedef struct bignum_ctx BN_CTX; 122 | typedef struct bn_blinding_st BN_BLINDING; 123 | typedef struct bn_mont_ctx_st BN_MONT_CTX; 124 | typedef struct bn_recp_ctx_st BN_RECP_CTX; 125 | typedef struct bn_gencb_st BN_GENCB; 126 | 127 | typedef struct buf_mem_st BUF_MEM; 128 | 129 | typedef struct evp_cipher_st EVP_CIPHER; 130 | typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX; 131 | typedef struct env_md_st EVP_MD; 132 | typedef struct env_md_ctx_st EVP_MD_CTX; 133 | typedef struct evp_pkey_st EVP_PKEY; 134 | 135 | typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD; 136 | 137 | typedef struct evp_pkey_method_st EVP_PKEY_METHOD; 138 | typedef struct evp_pkey_ctx_st EVP_PKEY_CTX; 139 | 140 | typedef struct dh_st DH; 141 | typedef struct dh_method DH_METHOD; 142 | 143 | typedef struct dsa_st DSA; 144 | typedef struct dsa_method DSA_METHOD; 145 | 146 | typedef struct rsa_st RSA; 147 | typedef struct rsa_meth_st RSA_METHOD; 148 | 149 | typedef struct rand_meth_st RAND_METHOD; 150 | 151 | typedef struct ecdh_method ECDH_METHOD; 152 | typedef struct ecdsa_method ECDSA_METHOD; 153 | 154 | typedef struct x509_st X509; 155 | typedef struct X509_algor_st X509_ALGOR; 156 | typedef struct X509_crl_st X509_CRL; 157 | typedef struct x509_crl_method_st X509_CRL_METHOD; 158 | typedef struct x509_revoked_st X509_REVOKED; 159 | typedef struct X509_name_st X509_NAME; 160 | typedef struct X509_pubkey_st X509_PUBKEY; 161 | typedef struct x509_store_st X509_STORE; 162 | typedef struct x509_store_ctx_st X509_STORE_CTX; 163 | 164 | typedef struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO; 165 | 166 | typedef struct v3_ext_ctx X509V3_CTX; 167 | typedef struct conf_st CONF; 168 | 169 | typedef struct store_st STORE; 170 | typedef struct store_method_st STORE_METHOD; 171 | 172 | typedef struct ui_st UI; 173 | typedef struct ui_method_st UI_METHOD; 174 | 175 | typedef struct st_ERR_FNS ERR_FNS; 176 | 177 | typedef struct engine_st ENGINE; 178 | typedef struct ssl_st SSL; 179 | typedef struct ssl_ctx_st SSL_CTX; 180 | 181 | typedef struct comp_method_st COMP_METHOD; 182 | 183 | typedef struct X509_POLICY_NODE_st X509_POLICY_NODE; 184 | typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL; 185 | typedef struct X509_POLICY_TREE_st X509_POLICY_TREE; 186 | typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE; 187 | 188 | typedef struct AUTHORITY_KEYID_st AUTHORITY_KEYID; 189 | typedef struct DIST_POINT_st DIST_POINT; 190 | typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT; 191 | typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS; 192 | 193 | /* If placed in pkcs12.h, we end up with a circular depency with pkcs7.h */ 194 | # define DECLARE_PKCS12_STACK_OF(type)/* Nothing */ 195 | # define IMPLEMENT_PKCS12_STACK_OF(type)/* Nothing */ 196 | 197 | typedef struct crypto_ex_data_st CRYPTO_EX_DATA; 198 | /* Callback types for crypto.h */ 199 | typedef int CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad, 200 | int idx, long argl, void *argp); 201 | typedef void CRYPTO_EX_free (void *parent, void *ptr, CRYPTO_EX_DATA *ad, 202 | int idx, long argl, void *argp); 203 | typedef int CRYPTO_EX_dup (CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, 204 | void *from_d, int idx, long argl, void *argp); 205 | 206 | typedef struct ocsp_req_ctx_st OCSP_REQ_CTX; 207 | typedef struct ocsp_response_st OCSP_RESPONSE; 208 | typedef struct ocsp_responder_id_st OCSP_RESPID; 209 | 210 | #ifdef __cplusplus 211 | } 212 | #endif 213 | #endif /* def HEADER_OPENSSL_TYPES_H */ 214 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/pem2.h: -------------------------------------------------------------------------------- 1 | /* ==================================================================== 2 | * Copyright (c) 1999 The OpenSSL Project. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * 3. All advertising materials mentioning features or use of this 17 | * software must display the following acknowledgment: 18 | * "This product includes software developed by the OpenSSL Project 19 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 20 | * 21 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 22 | * endorse or promote products derived from this software without 23 | * prior written permission. For written permission, please contact 24 | * licensing@OpenSSL.org. 25 | * 26 | * 5. Products derived from this software may not be called "OpenSSL" 27 | * nor may "OpenSSL" appear in their names without prior written 28 | * permission of the OpenSSL Project. 29 | * 30 | * 6. Redistributions of any form whatsoever must retain the following 31 | * acknowledgment: 32 | * "This product includes software developed by the OpenSSL Project 33 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 34 | * 35 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 36 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 37 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 38 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 39 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 40 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 41 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 42 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 43 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 44 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 45 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 46 | * OF THE POSSIBILITY OF SUCH DAMAGE. 47 | * ==================================================================== 48 | * 49 | * This product includes cryptographic software written by Eric Young 50 | * (eay@cryptsoft.com). This product includes software written by Tim 51 | * Hudson (tjh@cryptsoft.com). 52 | * 53 | */ 54 | 55 | /* 56 | * This header only exists to break a circular dependency between pem and err 57 | * Ben 30 Jan 1999. 58 | */ 59 | 60 | #ifdef __cplusplus 61 | extern "C" { 62 | #endif 63 | 64 | #ifndef HEADER_PEM_H 65 | void ERR_load_PEM_strings(void); 66 | #endif 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/pqueue.h: -------------------------------------------------------------------------------- 1 | /* crypto/pqueue/pqueue.h */ 2 | /* 3 | * DTLS implementation written by Nagendra Modadugu 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 5 | */ 6 | /* ==================================================================== 7 | * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in 18 | * the documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * 3. All advertising materials mentioning features or use of this 22 | * software must display the following acknowledgment: 23 | * "This product includes software developed by the OpenSSL Project 24 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 25 | * 26 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 27 | * endorse or promote products derived from this software without 28 | * prior written permission. For written permission, please contact 29 | * openssl-core@OpenSSL.org. 30 | * 31 | * 5. Products derived from this software may not be called "OpenSSL" 32 | * nor may "OpenSSL" appear in their names without prior written 33 | * permission of the OpenSSL Project. 34 | * 35 | * 6. Redistributions of any form whatsoever must retain the following 36 | * acknowledgment: 37 | * "This product includes software developed by the OpenSSL Project 38 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 39 | * 40 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 41 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 43 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 44 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 46 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 47 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 49 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 50 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51 | * OF THE POSSIBILITY OF SUCH DAMAGE. 52 | * ==================================================================== 53 | * 54 | * This product includes cryptographic software written by Eric Young 55 | * (eay@cryptsoft.com). This product includes software written by Tim 56 | * Hudson (tjh@cryptsoft.com). 57 | * 58 | */ 59 | 60 | #ifndef HEADER_PQUEUE_H 61 | # define HEADER_PQUEUE_H 62 | 63 | # include 64 | # include 65 | # include 66 | 67 | #ifdef __cplusplus 68 | extern "C" { 69 | #endif 70 | typedef struct _pqueue *pqueue; 71 | 72 | typedef struct _pitem { 73 | unsigned char priority[8]; /* 64-bit value in big-endian encoding */ 74 | void *data; 75 | struct _pitem *next; 76 | } pitem; 77 | 78 | typedef struct _pitem *piterator; 79 | 80 | pitem *pitem_new(unsigned char *prio64be, void *data); 81 | void pitem_free(pitem *item); 82 | 83 | pqueue pqueue_new(void); 84 | void pqueue_free(pqueue pq); 85 | 86 | pitem *pqueue_insert(pqueue pq, pitem *item); 87 | pitem *pqueue_peek(pqueue pq); 88 | pitem *pqueue_pop(pqueue pq); 89 | pitem *pqueue_find(pqueue pq, unsigned char *prio64be); 90 | pitem *pqueue_iterator(pqueue pq); 91 | pitem *pqueue_next(piterator *iter); 92 | 93 | void pqueue_print(pqueue pq); 94 | int pqueue_size(pqueue pq); 95 | 96 | #ifdef __cplusplus 97 | } 98 | #endif 99 | #endif /* ! HEADER_PQUEUE_H */ 100 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/rand.h: -------------------------------------------------------------------------------- 1 | /* crypto/rand/rand.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_RAND_H 60 | # define HEADER_RAND_H 61 | 62 | # include 63 | # include 64 | # include 65 | 66 | # if defined(OPENSSL_SYS_WINDOWS) 67 | # include 68 | # endif 69 | 70 | #ifdef __cplusplus 71 | extern "C" { 72 | #endif 73 | 74 | # if defined(OPENSSL_FIPS) 75 | # define FIPS_RAND_SIZE_T size_t 76 | # endif 77 | 78 | /* Already defined in ossl_typ.h */ 79 | /* typedef struct rand_meth_st RAND_METHOD; */ 80 | 81 | struct rand_meth_st { 82 | void (*seed) (const void *buf, int num); 83 | int (*bytes) (unsigned char *buf, int num); 84 | void (*cleanup) (void); 85 | void (*add) (const void *buf, int num, double entropy); 86 | int (*pseudorand) (unsigned char *buf, int num); 87 | int (*status) (void); 88 | }; 89 | 90 | # ifdef BN_DEBUG 91 | extern int rand_predictable; 92 | # endif 93 | 94 | int RAND_set_rand_method(const RAND_METHOD *meth); 95 | const RAND_METHOD *RAND_get_rand_method(void); 96 | # ifndef OPENSSL_NO_ENGINE 97 | int RAND_set_rand_engine(ENGINE *engine); 98 | # endif 99 | RAND_METHOD *RAND_SSLeay(void); 100 | void RAND_cleanup(void); 101 | int RAND_bytes(unsigned char *buf, int num); 102 | int RAND_pseudo_bytes(unsigned char *buf, int num); 103 | void RAND_seed(const void *buf, int num); 104 | void RAND_add(const void *buf, int num, double entropy); 105 | int RAND_load_file(const char *file, long max_bytes); 106 | int RAND_write_file(const char *file); 107 | const char *RAND_file_name(char *file, size_t num); 108 | int RAND_status(void); 109 | int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes); 110 | int RAND_egd(const char *path); 111 | int RAND_egd_bytes(const char *path, int bytes); 112 | int RAND_poll(void); 113 | 114 | # if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) 115 | 116 | void RAND_screen(void); 117 | int RAND_event(UINT, WPARAM, LPARAM); 118 | 119 | # endif 120 | 121 | # ifdef OPENSSL_FIPS 122 | void RAND_set_fips_drbg_type(int type, int flags); 123 | int RAND_init_fips(void); 124 | # endif 125 | 126 | /* BEGIN ERROR CODES */ 127 | /* 128 | * The following lines are auto generated by the script mkerr.pl. Any changes 129 | * made after this point may be overwritten when the script is next run. 130 | */ 131 | void ERR_load_RAND_strings(void); 132 | 133 | /* Error codes for the RAND functions. */ 134 | 135 | /* Function codes. */ 136 | # define RAND_F_RAND_GET_RAND_METHOD 101 137 | # define RAND_F_RAND_INIT_FIPS 102 138 | # define RAND_F_SSLEAY_RAND_BYTES 100 139 | 140 | /* Reason codes. */ 141 | # define RAND_R_DUAL_EC_DRBG_DISABLED 104 142 | # define RAND_R_ERROR_INITIALISING_DRBG 102 143 | # define RAND_R_ERROR_INSTANTIATING_DRBG 103 144 | # define RAND_R_NO_FIPS_RANDOM_METHOD_SET 101 145 | # define RAND_R_PRNG_NOT_SEEDED 100 146 | 147 | #ifdef __cplusplus 148 | } 149 | #endif 150 | #endif 151 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/rc2.h: -------------------------------------------------------------------------------- 1 | /* crypto/rc2/rc2.h */ 2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_RC2_H 60 | # define HEADER_RC2_H 61 | 62 | # include /* OPENSSL_NO_RC2, RC2_INT */ 63 | # ifdef OPENSSL_NO_RC2 64 | # error RC2 is disabled. 65 | # endif 66 | 67 | # define RC2_ENCRYPT 1 68 | # define RC2_DECRYPT 0 69 | 70 | # define RC2_BLOCK 8 71 | # define RC2_KEY_LENGTH 16 72 | 73 | #ifdef __cplusplus 74 | extern "C" { 75 | #endif 76 | 77 | typedef struct rc2_key_st { 78 | RC2_INT data[64]; 79 | } RC2_KEY; 80 | 81 | # ifdef OPENSSL_FIPS 82 | void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, 83 | int bits); 84 | # endif 85 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits); 86 | void RC2_ecb_encrypt(const unsigned char *in, unsigned char *out, 87 | RC2_KEY *key, int enc); 88 | void RC2_encrypt(unsigned long *data, RC2_KEY *key); 89 | void RC2_decrypt(unsigned long *data, RC2_KEY *key); 90 | void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, 91 | RC2_KEY *ks, unsigned char *iv, int enc); 92 | void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out, 93 | long length, RC2_KEY *schedule, unsigned char *ivec, 94 | int *num, int enc); 95 | void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out, 96 | long length, RC2_KEY *schedule, unsigned char *ivec, 97 | int *num); 98 | 99 | #ifdef __cplusplus 100 | } 101 | #endif 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/rc4.h: -------------------------------------------------------------------------------- 1 | /* crypto/rc4/rc4.h */ 2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_RC4_H 60 | # define HEADER_RC4_H 61 | 62 | # include /* OPENSSL_NO_RC4, RC4_INT */ 63 | # ifdef OPENSSL_NO_RC4 64 | # error RC4 is disabled. 65 | # endif 66 | 67 | # include 68 | 69 | #ifdef __cplusplus 70 | extern "C" { 71 | #endif 72 | 73 | typedef struct rc4_key_st { 74 | RC4_INT x, y; 75 | RC4_INT data[256]; 76 | } RC4_KEY; 77 | 78 | const char *RC4_options(void); 79 | void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); 80 | void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); 81 | void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, 82 | unsigned char *outdata); 83 | 84 | #ifdef __cplusplus 85 | } 86 | #endif 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/ripemd.h: -------------------------------------------------------------------------------- 1 | /* crypto/ripemd/ripemd.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_RIPEMD_H 60 | # define HEADER_RIPEMD_H 61 | 62 | # include 63 | # include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | # ifdef OPENSSL_NO_RIPEMD 70 | # error RIPEMD is disabled. 71 | # endif 72 | 73 | # if defined(__LP32__) 74 | # define RIPEMD160_LONG unsigned long 75 | # elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) 76 | # define RIPEMD160_LONG unsigned long 77 | # define RIPEMD160_LONG_LOG2 3 78 | # else 79 | # define RIPEMD160_LONG unsigned int 80 | # endif 81 | 82 | # define RIPEMD160_CBLOCK 64 83 | # define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4) 84 | # define RIPEMD160_DIGEST_LENGTH 20 85 | 86 | typedef struct RIPEMD160state_st { 87 | RIPEMD160_LONG A, B, C, D, E; 88 | RIPEMD160_LONG Nl, Nh; 89 | RIPEMD160_LONG data[RIPEMD160_LBLOCK]; 90 | unsigned int num; 91 | } RIPEMD160_CTX; 92 | 93 | # ifdef OPENSSL_FIPS 94 | int private_RIPEMD160_Init(RIPEMD160_CTX *c); 95 | # endif 96 | int RIPEMD160_Init(RIPEMD160_CTX *c); 97 | int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); 98 | int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); 99 | unsigned char *RIPEMD160(const unsigned char *d, size_t n, unsigned char *md); 100 | void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b); 101 | #ifdef __cplusplus 102 | } 103 | #endif 104 | 105 | #endif 106 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/seed.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 KISA(Korea Information Security Agency). All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Neither the name of author nor the names of its contributors may 10 | * be used to endorse or promote products derived from this software 11 | * without specific prior written permission. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE 17 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 | * SUCH DAMAGE. 24 | * 25 | */ 26 | /* ==================================================================== 27 | * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. 28 | * 29 | * Redistribution and use in source and binary forms, with or without 30 | * modification, are permitted provided that the following conditions 31 | * are met: 32 | * 33 | * 1. Redistributions of source code must retain the above copyright 34 | * notice, this list of conditions and the following disclaimer. 35 | * 36 | * 2. Redistributions in binary form must reproduce the above copyright 37 | * notice, this list of conditions and the following disclaimer in 38 | * the documentation and/or other materials provided with the 39 | * distribution. 40 | * 41 | * 3. All advertising materials mentioning features or use of this 42 | * software must display the following acknowledgment: 43 | * "This product includes software developed by the OpenSSL Project 44 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 45 | * 46 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 47 | * endorse or promote products derived from this software without 48 | * prior written permission. For written permission, please contact 49 | * openssl-core@openssl.org. 50 | * 51 | * 5. Products derived from this software may not be called "OpenSSL" 52 | * nor may "OpenSSL" appear in their names without prior written 53 | * permission of the OpenSSL Project. 54 | * 55 | * 6. Redistributions of any form whatsoever must retain the following 56 | * acknowledgment: 57 | * "This product includes software developed by the OpenSSL Project 58 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 59 | * 60 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 61 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 62 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 63 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 64 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 65 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 66 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 67 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 68 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 69 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 70 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 71 | * OF THE POSSIBILITY OF SUCH DAMAGE. 72 | * ==================================================================== 73 | * 74 | * This product includes cryptographic software written by Eric Young 75 | * (eay@cryptsoft.com). This product includes software written by Tim 76 | * Hudson (tjh@cryptsoft.com). 77 | * 78 | */ 79 | 80 | #ifndef HEADER_SEED_H 81 | # define HEADER_SEED_H 82 | 83 | # include 84 | # include 85 | # include 86 | 87 | # ifdef OPENSSL_NO_SEED 88 | # error SEED is disabled. 89 | # endif 90 | 91 | /* look whether we need 'long' to get 32 bits */ 92 | # ifdef AES_LONG 93 | # ifndef SEED_LONG 94 | # define SEED_LONG 1 95 | # endif 96 | # endif 97 | 98 | # if !defined(NO_SYS_TYPES_H) 99 | # include 100 | # endif 101 | 102 | # define SEED_BLOCK_SIZE 16 103 | # define SEED_KEY_LENGTH 16 104 | 105 | 106 | #ifdef __cplusplus 107 | extern "C" { 108 | #endif 109 | 110 | typedef struct seed_key_st { 111 | # ifdef SEED_LONG 112 | unsigned long data[32]; 113 | # else 114 | unsigned int data[32]; 115 | # endif 116 | } SEED_KEY_SCHEDULE; 117 | 118 | # ifdef OPENSSL_FIPS 119 | void private_SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH], 120 | SEED_KEY_SCHEDULE *ks); 121 | # endif 122 | void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH], 123 | SEED_KEY_SCHEDULE *ks); 124 | 125 | void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE], 126 | unsigned char d[SEED_BLOCK_SIZE], 127 | const SEED_KEY_SCHEDULE *ks); 128 | void SEED_decrypt(const unsigned char s[SEED_BLOCK_SIZE], 129 | unsigned char d[SEED_BLOCK_SIZE], 130 | const SEED_KEY_SCHEDULE *ks); 131 | 132 | void SEED_ecb_encrypt(const unsigned char *in, unsigned char *out, 133 | const SEED_KEY_SCHEDULE *ks, int enc); 134 | void SEED_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t len, 135 | const SEED_KEY_SCHEDULE *ks, 136 | unsigned char ivec[SEED_BLOCK_SIZE], int enc); 137 | void SEED_cfb128_encrypt(const unsigned char *in, unsigned char *out, 138 | size_t len, const SEED_KEY_SCHEDULE *ks, 139 | unsigned char ivec[SEED_BLOCK_SIZE], int *num, 140 | int enc); 141 | void SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out, 142 | size_t len, const SEED_KEY_SCHEDULE *ks, 143 | unsigned char ivec[SEED_BLOCK_SIZE], int *num); 144 | 145 | #ifdef __cplusplus 146 | } 147 | #endif 148 | 149 | #endif /* HEADER_SEED_H */ 150 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/srp.h: -------------------------------------------------------------------------------- 1 | /* crypto/srp/srp.h */ 2 | /* 3 | * Written by Christophe Renou (christophe.renou@edelweb.fr) with the 4 | * precious help of Peter Sylvester (peter.sylvester@edelweb.fr) for the 5 | * EdelKey project and contributed to the OpenSSL project 2004. 6 | */ 7 | /* ==================================================================== 8 | * Copyright (c) 2004 The OpenSSL Project. All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * 17 | * 2. Redistributions in binary form must reproduce the above copyright 18 | * notice, this list of conditions and the following disclaimer in 19 | * the documentation and/or other materials provided with the 20 | * distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgment: 24 | * "This product includes software developed by the OpenSSL Project 25 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 26 | * 27 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 28 | * endorse or promote products derived from this software without 29 | * prior written permission. For written permission, please contact 30 | * licensing@OpenSSL.org. 31 | * 32 | * 5. Products derived from this software may not be called "OpenSSL" 33 | * nor may "OpenSSL" appear in their names without prior written 34 | * permission of the OpenSSL Project. 35 | * 36 | * 6. Redistributions of any form whatsoever must retain the following 37 | * acknowledgment: 38 | * "This product includes software developed by the OpenSSL Project 39 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 42 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 44 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 45 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 46 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 47 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 48 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 49 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 50 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 51 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 52 | * OF THE POSSIBILITY OF SUCH DAMAGE. 53 | * ==================================================================== 54 | * 55 | * This product includes cryptographic software written by Eric Young 56 | * (eay@cryptsoft.com). This product includes software written by Tim 57 | * Hudson (tjh@cryptsoft.com). 58 | * 59 | */ 60 | #ifndef __SRP_H__ 61 | # define __SRP_H__ 62 | 63 | # ifndef OPENSSL_NO_SRP 64 | 65 | # include 66 | # include 67 | 68 | #ifdef __cplusplus 69 | extern "C" { 70 | #endif 71 | 72 | # include 73 | # include 74 | # include 75 | 76 | typedef struct SRP_gN_cache_st { 77 | char *b64_bn; 78 | BIGNUM *bn; 79 | } SRP_gN_cache; 80 | 81 | 82 | DECLARE_STACK_OF(SRP_gN_cache) 83 | 84 | typedef struct SRP_user_pwd_st { 85 | /* Owned by us. */ 86 | char *id; 87 | BIGNUM *s; 88 | BIGNUM *v; 89 | /* Not owned by us. */ 90 | const BIGNUM *g; 91 | const BIGNUM *N; 92 | /* Owned by us. */ 93 | char *info; 94 | } SRP_user_pwd; 95 | 96 | DECLARE_STACK_OF(SRP_user_pwd) 97 | 98 | void SRP_user_pwd_free(SRP_user_pwd *user_pwd); 99 | 100 | typedef struct SRP_VBASE_st { 101 | STACK_OF(SRP_user_pwd) *users_pwd; 102 | STACK_OF(SRP_gN_cache) *gN_cache; 103 | /* to simulate a user */ 104 | char *seed_key; 105 | BIGNUM *default_g; 106 | BIGNUM *default_N; 107 | } SRP_VBASE; 108 | 109 | /* 110 | * Structure interne pour retenir les couples N et g 111 | */ 112 | typedef struct SRP_gN_st { 113 | char *id; 114 | BIGNUM *g; 115 | BIGNUM *N; 116 | } SRP_gN; 117 | 118 | DECLARE_STACK_OF(SRP_gN) 119 | 120 | SRP_VBASE *SRP_VBASE_new(char *seed_key); 121 | int SRP_VBASE_free(SRP_VBASE *vb); 122 | int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file); 123 | 124 | /* This method ignores the configured seed and fails for an unknown user. */ 125 | SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username); 126 | /* NOTE: unlike in SRP_VBASE_get_by_user, caller owns the returned pointer.*/ 127 | SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username); 128 | 129 | char *SRP_create_verifier(const char *user, const char *pass, char **salt, 130 | char **verifier, const char *N, const char *g); 131 | int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, 132 | BIGNUM **verifier, BIGNUM *N, BIGNUM *g); 133 | 134 | # define SRP_NO_ERROR 0 135 | # define SRP_ERR_VBASE_INCOMPLETE_FILE 1 136 | # define SRP_ERR_VBASE_BN_LIB 2 137 | # define SRP_ERR_OPEN_FILE 3 138 | # define SRP_ERR_MEMORY 4 139 | 140 | # define DB_srptype 0 141 | # define DB_srpverifier 1 142 | # define DB_srpsalt 2 143 | # define DB_srpid 3 144 | # define DB_srpgN 4 145 | # define DB_srpinfo 5 146 | # undef DB_NUMBER 147 | # define DB_NUMBER 6 148 | 149 | # define DB_SRP_INDEX 'I' 150 | # define DB_SRP_VALID 'V' 151 | # define DB_SRP_REVOKED 'R' 152 | # define DB_SRP_MODIF 'v' 153 | 154 | /* see srp.c */ 155 | char *SRP_check_known_gN_param(BIGNUM *g, BIGNUM *N); 156 | SRP_gN *SRP_get_default_gN(const char *id); 157 | 158 | /* server side .... */ 159 | BIGNUM *SRP_Calc_server_key(BIGNUM *A, BIGNUM *v, BIGNUM *u, BIGNUM *b, 160 | BIGNUM *N); 161 | BIGNUM *SRP_Calc_B(BIGNUM *b, BIGNUM *N, BIGNUM *g, BIGNUM *v); 162 | int SRP_Verify_A_mod_N(BIGNUM *A, BIGNUM *N); 163 | BIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N); 164 | 165 | /* client side .... */ 166 | BIGNUM *SRP_Calc_x(BIGNUM *s, const char *user, const char *pass); 167 | BIGNUM *SRP_Calc_A(BIGNUM *a, BIGNUM *N, BIGNUM *g); 168 | BIGNUM *SRP_Calc_client_key(BIGNUM *N, BIGNUM *B, BIGNUM *g, BIGNUM *x, 169 | BIGNUM *a, BIGNUM *u); 170 | int SRP_Verify_B_mod_N(BIGNUM *B, BIGNUM *N); 171 | 172 | # define SRP_MINIMAL_N 1024 173 | 174 | #ifdef __cplusplus 175 | } 176 | #endif 177 | 178 | # endif 179 | #endif 180 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/srtp.h: -------------------------------------------------------------------------------- 1 | /* ssl/srtp.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | /* ==================================================================== 59 | * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. 60 | * 61 | * Redistribution and use in source and binary forms, with or without 62 | * modification, are permitted provided that the following conditions 63 | * are met: 64 | * 65 | * 1. Redistributions of source code must retain the above copyright 66 | * notice, this list of conditions and the following disclaimer. 67 | * 68 | * 2. Redistributions in binary form must reproduce the above copyright 69 | * notice, this list of conditions and the following disclaimer in 70 | * the documentation and/or other materials provided with the 71 | * distribution. 72 | * 73 | * 3. All advertising materials mentioning features or use of this 74 | * software must display the following acknowledgment: 75 | * "This product includes software developed by the OpenSSL Project 76 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 77 | * 78 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 79 | * endorse or promote products derived from this software without 80 | * prior written permission. For written permission, please contact 81 | * openssl-core@openssl.org. 82 | * 83 | * 5. Products derived from this software may not be called "OpenSSL" 84 | * nor may "OpenSSL" appear in their names without prior written 85 | * permission of the OpenSSL Project. 86 | * 87 | * 6. Redistributions of any form whatsoever must retain the following 88 | * acknowledgment: 89 | * "This product includes software developed by the OpenSSL Project 90 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 91 | * 92 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 93 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 94 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 95 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 96 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 97 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 98 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 99 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 100 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 101 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 102 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 103 | * OF THE POSSIBILITY OF SUCH DAMAGE. 104 | * ==================================================================== 105 | * 106 | * This product includes cryptographic software written by Eric Young 107 | * (eay@cryptsoft.com). This product includes software written by Tim 108 | * Hudson (tjh@cryptsoft.com). 109 | * 110 | */ 111 | /* 112 | * DTLS code by Eric Rescorla 113 | * 114 | * Copyright (C) 2006, Network Resonance, Inc. Copyright (C) 2011, RTFM, Inc. 115 | */ 116 | 117 | #ifndef HEADER_D1_SRTP_H 118 | # define HEADER_D1_SRTP_H 119 | 120 | # include 121 | 122 | #ifdef __cplusplus 123 | extern "C" { 124 | #endif 125 | 126 | # define SRTP_AES128_CM_SHA1_80 0x0001 127 | # define SRTP_AES128_CM_SHA1_32 0x0002 128 | # define SRTP_AES128_F8_SHA1_80 0x0003 129 | # define SRTP_AES128_F8_SHA1_32 0x0004 130 | # define SRTP_NULL_SHA1_80 0x0005 131 | # define SRTP_NULL_SHA1_32 0x0006 132 | 133 | # ifndef OPENSSL_NO_SRTP 134 | 135 | int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles); 136 | int SSL_set_tlsext_use_srtp(SSL *ctx, const char *profiles); 137 | 138 | STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl); 139 | SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s); 140 | 141 | # endif 142 | 143 | #ifdef __cplusplus 144 | } 145 | #endif 146 | 147 | #endif 148 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/ssl23.h: -------------------------------------------------------------------------------- 1 | /* ssl/ssl23.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_SSL23_H 60 | # define HEADER_SSL23_H 61 | 62 | #ifdef __cplusplus 63 | extern "C" { 64 | #endif 65 | 66 | /* 67 | * client 68 | */ 69 | /* write to server */ 70 | # define SSL23_ST_CW_CLNT_HELLO_A (0x210|SSL_ST_CONNECT) 71 | # define SSL23_ST_CW_CLNT_HELLO_B (0x211|SSL_ST_CONNECT) 72 | /* read from server */ 73 | # define SSL23_ST_CR_SRVR_HELLO_A (0x220|SSL_ST_CONNECT) 74 | # define SSL23_ST_CR_SRVR_HELLO_B (0x221|SSL_ST_CONNECT) 75 | 76 | /* server */ 77 | /* read from client */ 78 | # define SSL23_ST_SR_CLNT_HELLO_A (0x210|SSL_ST_ACCEPT) 79 | # define SSL23_ST_SR_CLNT_HELLO_B (0x211|SSL_ST_ACCEPT) 80 | 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | #endif 85 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/stack.h: -------------------------------------------------------------------------------- 1 | /* crypto/stack/stack.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_STACK_H 60 | # define HEADER_STACK_H 61 | 62 | #ifdef __cplusplus 63 | extern "C" { 64 | #endif 65 | 66 | typedef struct stack_st { 67 | int num; 68 | char **data; 69 | int sorted; 70 | int num_alloc; 71 | int (*comp) (const void *, const void *); 72 | } _STACK; /* Use STACK_OF(...) instead */ 73 | 74 | # define M_sk_num(sk) ((sk) ? (sk)->num:-1) 75 | # define M_sk_value(sk,n) ((sk) ? (sk)->data[n] : NULL) 76 | 77 | int sk_num(const _STACK *); 78 | void *sk_value(const _STACK *, int); 79 | 80 | void *sk_set(_STACK *, int, void *); 81 | 82 | _STACK *sk_new(int (*cmp) (const void *, const void *)); 83 | _STACK *sk_new_null(void); 84 | void sk_free(_STACK *); 85 | void sk_pop_free(_STACK *st, void (*func) (void *)); 86 | _STACK *sk_deep_copy(_STACK *, void *(*)(void *), void (*)(void *)); 87 | int sk_insert(_STACK *sk, void *data, int where); 88 | void *sk_delete(_STACK *st, int loc); 89 | void *sk_delete_ptr(_STACK *st, void *p); 90 | int sk_find(_STACK *st, void *data); 91 | int sk_find_ex(_STACK *st, void *data); 92 | int sk_push(_STACK *st, void *data); 93 | int sk_unshift(_STACK *st, void *data); 94 | void *sk_shift(_STACK *st); 95 | void *sk_pop(_STACK *st); 96 | void sk_zero(_STACK *st); 97 | int (*sk_set_cmp_func(_STACK *sk, int (*c) (const void *, const void *))) 98 | (const void *, const void *); 99 | _STACK *sk_dup(_STACK *st); 100 | void sk_sort(_STACK *st); 101 | int sk_is_sorted(const _STACK *st); 102 | 103 | #ifdef __cplusplus 104 | } 105 | #endif 106 | 107 | #endif 108 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/txt_db.h: -------------------------------------------------------------------------------- 1 | /* crypto/txt_db/txt_db.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_TXT_DB_H 60 | # define HEADER_TXT_DB_H 61 | 62 | # include 63 | # ifndef OPENSSL_NO_BIO 64 | # include 65 | # endif 66 | # include 67 | # include 68 | 69 | # define DB_ERROR_OK 0 70 | # define DB_ERROR_MALLOC 1 71 | # define DB_ERROR_INDEX_CLASH 2 72 | # define DB_ERROR_INDEX_OUT_OF_RANGE 3 73 | # define DB_ERROR_NO_INDEX 4 74 | # define DB_ERROR_INSERT_INDEX_CLASH 5 75 | 76 | #ifdef __cplusplus 77 | extern "C" { 78 | #endif 79 | 80 | typedef OPENSSL_STRING *OPENSSL_PSTRING; 81 | DECLARE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING) 82 | 83 | typedef struct txt_db_st { 84 | int num_fields; 85 | STACK_OF(OPENSSL_PSTRING) *data; 86 | LHASH_OF(OPENSSL_STRING) **index; 87 | int (**qual) (OPENSSL_STRING *); 88 | long error; 89 | long arg1; 90 | long arg2; 91 | OPENSSL_STRING *arg_row; 92 | } TXT_DB; 93 | 94 | # ifndef OPENSSL_NO_BIO 95 | TXT_DB *TXT_DB_read(BIO *in, int num); 96 | long TXT_DB_write(BIO *out, TXT_DB *db); 97 | # else 98 | TXT_DB *TXT_DB_read(char *in, int num); 99 | long TXT_DB_write(char *out, TXT_DB *db); 100 | # endif 101 | int TXT_DB_create_index(TXT_DB *db, int field, int (*qual) (OPENSSL_STRING *), 102 | LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp); 103 | void TXT_DB_free(TXT_DB *db); 104 | OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx, 105 | OPENSSL_STRING *value); 106 | int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *value); 107 | 108 | #ifdef __cplusplus 109 | } 110 | #endif 111 | 112 | #endif 113 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/ui_compat.h: -------------------------------------------------------------------------------- 1 | /* crypto/ui/ui.h */ 2 | /* 3 | * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project 4 | * 2001. 5 | */ 6 | /* ==================================================================== 7 | * Copyright (c) 2001 The OpenSSL Project. All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in 18 | * the documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * 3. All advertising materials mentioning features or use of this 22 | * software must display the following acknowledgment: 23 | * "This product includes software developed by the OpenSSL Project 24 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 25 | * 26 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 27 | * endorse or promote products derived from this software without 28 | * prior written permission. For written permission, please contact 29 | * openssl-core@openssl.org. 30 | * 31 | * 5. Products derived from this software may not be called "OpenSSL" 32 | * nor may "OpenSSL" appear in their names without prior written 33 | * permission of the OpenSSL Project. 34 | * 35 | * 6. Redistributions of any form whatsoever must retain the following 36 | * acknowledgment: 37 | * "This product includes software developed by the OpenSSL Project 38 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 39 | * 40 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 41 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 43 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 44 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 46 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 47 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 49 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 50 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51 | * OF THE POSSIBILITY OF SUCH DAMAGE. 52 | * ==================================================================== 53 | * 54 | * This product includes cryptographic software written by Eric Young 55 | * (eay@cryptsoft.com). This product includes software written by Tim 56 | * Hudson (tjh@cryptsoft.com). 57 | * 58 | */ 59 | 60 | #ifndef HEADER_UI_COMPAT_H 61 | # define HEADER_UI_COMPAT_H 62 | 63 | # include 64 | # include 65 | 66 | #ifdef __cplusplus 67 | extern "C" { 68 | #endif 69 | 70 | /* 71 | * The following functions were previously part of the DES section, and are 72 | * provided here for backward compatibility reasons. 73 | */ 74 | 75 | # define des_read_pw_string(b,l,p,v) \ 76 | _ossl_old_des_read_pw_string((b),(l),(p),(v)) 77 | # define des_read_pw(b,bf,s,p,v) \ 78 | _ossl_old_des_read_pw((b),(bf),(s),(p),(v)) 79 | 80 | int _ossl_old_des_read_pw_string(char *buf, int length, const char *prompt, 81 | int verify); 82 | int _ossl_old_des_read_pw(char *buf, char *buff, int size, const char *prompt, 83 | int verify); 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | #endif 89 | -------------------------------------------------------------------------------- /3rdparty/openssl/include/openssl/whrlpool.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_WHRLPOOL_H 2 | # define HEADER_WHRLPOOL_H 3 | 4 | # include 5 | # include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | # define WHIRLPOOL_DIGEST_LENGTH (512/8) 12 | # define WHIRLPOOL_BBLOCK 512 13 | # define WHIRLPOOL_COUNTER (256/8) 14 | 15 | typedef struct { 16 | union { 17 | unsigned char c[WHIRLPOOL_DIGEST_LENGTH]; 18 | /* double q is here to ensure 64-bit alignment */ 19 | double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)]; 20 | } H; 21 | unsigned char data[WHIRLPOOL_BBLOCK / 8]; 22 | unsigned int bitoff; 23 | size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)]; 24 | } WHIRLPOOL_CTX; 25 | 26 | # ifndef OPENSSL_NO_WHIRLPOOL 27 | # ifdef OPENSSL_FIPS 28 | int private_WHIRLPOOL_Init(WHIRLPOOL_CTX *c); 29 | # endif 30 | int WHIRLPOOL_Init(WHIRLPOOL_CTX *c); 31 | int WHIRLPOOL_Update(WHIRLPOOL_CTX *c, const void *inp, size_t bytes); 32 | void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, const void *inp, size_t bits); 33 | int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c); 34 | unsigned char *WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md); 35 | # endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /3rdparty/openssl/lib/linux_lib_x64/libcrypto.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wqvbjhc/libuv_tcp/8be9bf2df6a230ae53a1ea88b5bd1321d39811a7/3rdparty/openssl/lib/linux_lib_x64/libcrypto.a -------------------------------------------------------------------------------- /3rdparty/openssl/lib/linux_lib_x64/libssl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wqvbjhc/libuv_tcp/8be9bf2df6a230ae53a1ea88b5bd1321d39811a7/3rdparty/openssl/lib/linux_lib_x64/libssl.a -------------------------------------------------------------------------------- /3rdparty/openssl/lib/vc_lib/libeay32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wqvbjhc/libuv_tcp/8be9bf2df6a230ae53a1ea88b5bd1321d39811a7/3rdparty/openssl/lib/vc_lib/libeay32.lib -------------------------------------------------------------------------------- /3rdparty/openssl/lib/vc_lib/libeay32d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wqvbjhc/libuv_tcp/8be9bf2df6a230ae53a1ea88b5bd1321d39811a7/3rdparty/openssl/lib/vc_lib/libeay32d.lib -------------------------------------------------------------------------------- /3rdparty/openssl/lib/vc_lib/ssleay32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wqvbjhc/libuv_tcp/8be9bf2df6a230ae53a1ea88b5bd1321d39811a7/3rdparty/openssl/lib/vc_lib/ssleay32.lib -------------------------------------------------------------------------------- /3rdparty/openssl/lib/vc_lib/ssleay32d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wqvbjhc/libuv_tcp/8be9bf2df6a230ae53a1ea88b5bd1321d39811a7/3rdparty/openssl/lib/vc_lib/ssleay32d.lib -------------------------------------------------------------------------------- /3rdparty/openssl/lib/vc_lib_x64/libeay32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wqvbjhc/libuv_tcp/8be9bf2df6a230ae53a1ea88b5bd1321d39811a7/3rdparty/openssl/lib/vc_lib_x64/libeay32.lib -------------------------------------------------------------------------------- /3rdparty/openssl/lib/vc_lib_x64/libeay32d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wqvbjhc/libuv_tcp/8be9bf2df6a230ae53a1ea88b5bd1321d39811a7/3rdparty/openssl/lib/vc_lib_x64/libeay32d.lib -------------------------------------------------------------------------------- /3rdparty/openssl/lib/vc_lib_x64/ssleay32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wqvbjhc/libuv_tcp/8be9bf2df6a230ae53a1ea88b5bd1321d39811a7/3rdparty/openssl/lib/vc_lib_x64/ssleay32.lib -------------------------------------------------------------------------------- /3rdparty/openssl/lib/vc_lib_x64/ssleay32d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wqvbjhc/libuv_tcp/8be9bf2df6a230ae53a1ea88b5bd1321d39811a7/3rdparty/openssl/lib/vc_lib_x64/ssleay32d.lib -------------------------------------------------------------------------------- /3rdparty/openssl/readme.txt: -------------------------------------------------------------------------------- 1 | Home: https://www.openssl.org/ 2 | Version: 1.0.2r -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #################### project ################################# 2 | cmake_minimum_required(VERSION 3.16) 3 | if(POLICY CMP0091) 4 | cmake_policy(SET CMP0091 NEW) 5 | elseif(MSVC) 6 | message(FATAL_ERROR "Please upgrade your CMake version to >= 3.15.") 7 | endif() 8 | project(libuv_tcp) 9 | set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory" FORCE) 10 | 11 | set(platform_link_flags "") 12 | if(CMAKE_GENERATOR MATCHES "Visual Studio" OR MSVC) 13 | message("MSVC") 14 | #### 设置多核编译 15 | add_compile_options($<$:/MP>) 16 | 17 | #### 设置C++17 18 | #set(CMAKE_CXX_STANDARD 17) 19 | add_compile_options($<$:/std:c++latest>) 20 | 21 | #### 设置msvc static runtime library 22 | get_directory_property(hasParent PARENT_DIRECTORY) 23 | if(hasParent) 24 | set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>" PARENT_SCOPE) 25 | else() 26 | set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") 27 | endif() 28 | #### 解决min,max冲突 29 | # add_definitions(-DNOMINMAX) 30 | add_compile_options($<$:-DNOMINMAX>) 31 | add_compile_options($<$:-D_CRT_SECURE_NO_WARNINGS>) 32 | 33 | #### fatal error C1060: 编译器的堆空间不足 34 | add_compile_options($<$:/Zm2000>) 35 | 36 | ### find libuv 37 | set(LIBUV_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/libuv) 38 | if(CMAKE_CL_64 OR ${CMAKE_SIZEOF_VOID_P} EQUAL "8") # -- 64-bit builds. 39 | set(LIBUV_LIB_DIRS "${LIBUV_DIR}/lib/vc_lib_x64") 40 | else() # -- 32-bit builds. 41 | set(LIBUV_LIB_DIRS "${LIBUV_DIR}/lib/vc_lib") 42 | endif() 43 | set(LIBUV_FOUND True) 44 | set(LIBUV_INCLUDE_DIRS ${LIBUV_DIR}/include) 45 | set(LIBUV_LIBRARIES libuv$<$:d>) # check if debug 46 | include_directories(${LIBUV_INCLUDE_DIRS}) 47 | link_directories(${LIBUV_LIB_DIRS}) 48 | 49 | ### find openssl 50 | set(OpenSSL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/openssl) 51 | if(CMAKE_CL_64 OR ${CMAKE_SIZEOF_VOID_P} EQUAL "8") # -- 64-bit builds. 52 | set(OPENSSL_LIB_DIRS "${OpenSSL_DIR}/lib/vc_lib_x64") 53 | else() # -- 32-bit builds. 54 | set(OPENSSL_LIB_DIRS "${OpenSSL_DIR}/lib/vc_lib") 55 | endif() 56 | set(OpenSSL_FOUND True) 57 | set(OPENSSL_INCLUDE_DIR ${OpenSSL_DIR}/include) 58 | include_directories(${OPENSSL_INCLUDE_DIR}) 59 | link_directories(${OPENSSL_LIB_DIRS}) 60 | set(OPENSSL_LIBRARIES 61 | libeay32$<$:d> ssleay32$<$:d>) 62 | 63 | ######## 64 | list(APPEND platform_link_flags Iphlpapi Userenv) 65 | 66 | else() 67 | add_compile_options(-fPIC) 68 | ################### check c++11 or c++0x ################################### 69 | include(CheckCXXCompilerFlag) 70 | CHECK_CXX_COMPILER_FLAG("-std=c++17" COMPILER_SUPPORTS_CXX17) 71 | CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) 72 | if(COMPILER_SUPPORTS_CXX17) 73 | set(CMAKE_CXX_STANDARD 17) 74 | # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") 75 | elseif(COMPILER_SUPPORTS_CXX11) 76 | set(CMAKE_CXX_STANDARD 11) 77 | # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") 78 | else() 79 | message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") 80 | endif() 81 | 82 | ### find libuv 83 | set(LIBUV_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/libuv) 84 | if(CMAKE_CL_64 OR ${CMAKE_SIZEOF_VOID_P} EQUAL "8") # -- 64-bit builds. 85 | set(LIBUV_LIB_DIRS "${LIBUV_DIR}/lib/linux_lib_x64") 86 | else() # -- 32-bit builds. 87 | set(LIBUV_LIB_DIRS "${LIBUV_DIR}/lib/linux_lib") 88 | endif() 89 | set(LIBUV_FOUND True) 90 | set(LIBUV_INCLUDE_DIRS ${LIBUV_DIR}/include) 91 | set(LIBUV_LIBRARIES uv) 92 | include_directories(${LIBUV_INCLUDE_DIRS}) 93 | link_directories(${LIBUV_LIB_DIRS}) 94 | 95 | ### find openssl 96 | set(OpenSSL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/openssl) 97 | if(CMAKE_CL_64 OR ${CMAKE_SIZEOF_VOID_P} EQUAL "8") # -- 64-bit builds. 98 | set(OPENSSL_LIB_DIRS "${OpenSSL_DIR}/lib/linux_lib_x64") 99 | else() # -- 32-bit builds. 100 | set(OPENSSL_LIB_DIRS "${OpenSSL_DIR}/lib/linux_lib") 101 | endif() 102 | set(OpenSSL_FOUND True) 103 | set(OPENSSL_INCLUDE_DIR ${OpenSSL_DIR}/include) 104 | include_directories(${OPENSSL_INCLUDE_DIR}) 105 | link_directories(${OPENSSL_LIB_DIRS}) 106 | set(OPENSSL_LIBRARIES crypto ssl) 107 | 108 | list(APPEND platform_link_flags pthread) 109 | 110 | endif() 111 | 112 | message(STATUS "Find Libuv ${LIBUV_FOUND}") 113 | message(STATUS " Libuv include dir: ${LIBUV_INCLUDE_DIRS}") 114 | message(STATUS " Libuv libraries: ${LIBUV_LIBRARIES}") 115 | message(STATUS "Find OpenSSL ${OpenSSL_FOUND}") 116 | message(STATUS " OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}") 117 | message(STATUS " OpenSSL libraries: ${OPENSSL_LIBRARIES}") 118 | 119 | ################################################################ 120 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 121 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/log4z) 122 | 123 | set(test_tcpclient_reconnect 124 | test_tcpclient_reconnect.cpp 125 | tcpclient.cpp 126 | log4z/log4z.cpp 127 | ) 128 | 129 | set(test_tcpclient 130 | test_tcpclient.cpp 131 | tcpclient.cpp 132 | log4z/log4z.cpp 133 | ) 134 | 135 | set(test_tcpserver 136 | test_tcpserver.cpp 137 | tcpserver.cpp 138 | log4z/log4z.cpp 139 | ) 140 | 141 | add_executable(test_tcpclient_reconnect ${test_tcpclient_reconnect}) 142 | target_link_libraries(test_tcpclient_reconnect ${LIBUV_LIBRARIES} ${OPENSSL_LIBRARIES} ${platform_link_flags}) 143 | 144 | add_executable(test_tcpclient ${test_tcpclient}) 145 | target_link_libraries(test_tcpclient ${LIBUV_LIBRARIES} ${OPENSSL_LIBRARIES} ${platform_link_flags}) 146 | 147 | add_executable(test_tcpserver ${test_tcpserver}) 148 | target_link_libraries(test_tcpserver ${LIBUV_LIBRARIES} ${OPENSSL_LIBRARIES} ${platform_link_flags}) 149 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, wqvbjhc 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of the {organization} nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Welcome to the libuv_tcp wiki! 2 | ------- 3 | # Introduction 4 | 5 | libuv_tcp is an C++ class that include tcp server and client which package using libuv. 6 | 7 | # Build the demo 8 | 9 | ## Build for Windows using Visual Studio 10 | 11 | ``` 12 | cd libuv_tcp 13 | mkdir -p build_win64 14 | cd build_win64 15 | cmake -A x64 -DCMAKE_BUILD_TYPE=Release .. 16 | cmake --build . --config Release 17 | ``` 18 | 19 | ## Build for Linux 20 | 21 | ``` 22 | cd libuv_tcp 23 | mkdir -p build_linux 24 | cd build_linux 25 | cmake .. 26 | make -j 27 | ``` 28 | 29 | # Usage 30 | 31 | Refer to [**test_tcpserver.cpp**] [1] and [**test_tcpclient.cpp**] [1] 32 | 33 | # Author: Phata 34 | 35 | Blog: http://www.cnblogs.com/wqvbjhc/ 36 | 37 | E-mail: feitemj@gmail.com 38 | 39 | QQ: 1930952842 40 | 41 | Github: https://github.com/wqvbjhc 42 | 43 | 44 | 45 | [1]: https://github.com/wqvbjhc/libuv_tcp/blob/master/test_tcpserver.cpp/ "TCPServer Sample" 46 | 47 | [2]: https://github.com/wqvbjhc/libuv_tcp/blob/master/test_tcpclient.cpp "TCPClient Sample" 48 | -------------------------------------------------------------------------------- /sys/thread_uv.h: -------------------------------------------------------------------------------- 1 | /***************************************** 2 | * @file thread_uv.h 3 | * @brief 对libuv下的线程与锁进行封装 4 | * @details 5 | * @author phata,wqvbjhc@gmail.com 6 | * @date 2014-10-27 7 | * @mod 2015-03-24 phata uv_err_name,uv_strerror返回NULL时直接转string会崩溃,先判断 8 | ******************************************/ 9 | #ifndef COMMON_THREAD_UV_H 10 | #define COMMON_THREAD_UV_H 11 | #include 12 | #include "uv.h" 13 | 14 | //对Android平台,也认为是linux 15 | #ifdef ANDROID 16 | #define __linux__ ANDROID 17 | #endif 18 | //包含头文件 19 | #if defined (WIN32) || defined(_WIN32) 20 | #include 21 | #endif 22 | #ifdef __linux__ 23 | #include 24 | #include 25 | #endif 26 | 27 | //函数 28 | #if defined (WIN32) || defined(_WIN32) 29 | #define uv_thread_close(t) (CloseHandle(t)!=FALSE) 30 | #define uv_thread_sleep(ms) Sleep(ms);//睡眠ms毫秒 31 | #define uv_thread_id GetCurrentThreadId//得到当前线程句柄 32 | 33 | #elif defined(__linux__) 34 | #define uv_thread_close(t) () 35 | #define uv_thread_sleep(ms) usleep((ms) * 1000) 36 | #define uv_thread_id pthread_self//得到当前线程句柄 37 | 38 | #else 39 | #error "no supported os" 40 | #endif 41 | 42 | /***************************** 43 | * @brief 获取libuv错误码对应的错误信息 44 | * @param errcode --libuv函数错误码(不等于0的返回值) 45 | * @return std::string --返回的详细错误说明 46 | ******************************/ 47 | inline std::string GetUVError(int errcode) 48 | { 49 | if (0 == errcode) { 50 | return ""; 51 | } 52 | std::string err; 53 | auto tmpChar = uv_err_name(errcode); 54 | if (tmpChar) { 55 | err = tmpChar; 56 | err += ":"; 57 | }else{ 58 | err = "unknown system errcode "+std::to_string((long long)errcode); 59 | err += ":"; 60 | } 61 | tmpChar = uv_strerror(errcode); 62 | if (tmpChar) { 63 | err += tmpChar; 64 | } 65 | return std::move(err); 66 | } 67 | 68 | //互斥量,配合CUVAutoLock使用更方便 69 | class CUVMutex 70 | { 71 | public: 72 | explicit CUVMutex() 73 | { 74 | uv_mutex_init(&mut_); 75 | } 76 | ~CUVMutex(void) 77 | { 78 | uv_mutex_destroy(&mut_); 79 | } 80 | void Lock() 81 | { 82 | uv_mutex_lock(&mut_); 83 | } 84 | void UnLock() 85 | { 86 | uv_mutex_unlock(&mut_); 87 | } 88 | bool TryLock() 89 | { 90 | return uv_mutex_trylock(&mut_) == 0; 91 | } 92 | private: 93 | uv_mutex_t mut_; 94 | friend class CUVCond; 95 | friend class CUVAutoLock; 96 | private://private中,禁止复制和赋值 97 | CUVMutex(const CUVMutex&);//不实现 98 | CUVMutex& operator =(const CUVMutex&);//不实现 99 | }; 100 | 101 | class CUVAutoLock 102 | { 103 | public: 104 | explicit CUVAutoLock(uv_mutex_t* mut): mut_(mut) 105 | { 106 | uv_mutex_lock(mut_); 107 | } 108 | explicit CUVAutoLock(CUVMutex* mut): mut_(&mut->mut_) 109 | { 110 | uv_mutex_lock(mut_); 111 | } 112 | ~CUVAutoLock(void) 113 | { 114 | uv_mutex_unlock(mut_); 115 | } 116 | private: 117 | uv_mutex_t* mut_; 118 | private://private中,禁止复制和赋值 119 | CUVAutoLock(const CUVAutoLock&);//不实现 120 | CUVAutoLock& operator =(const CUVAutoLock&);//不实现 121 | }; 122 | 123 | //条件变量 124 | class CUVCond 125 | { 126 | public: 127 | explicit CUVCond() 128 | { 129 | uv_cond_init(&cond_); 130 | } 131 | ~CUVCond(void) 132 | { 133 | uv_cond_destroy(&cond_); 134 | } 135 | void Signal() 136 | { 137 | uv_cond_signal(&cond_); 138 | } 139 | void BroadCast() 140 | { 141 | uv_cond_broadcast(&cond_); 142 | } 143 | void Wait(CUVMutex* mutex) 144 | { 145 | uv_cond_wait(&cond_, &mutex->mut_); 146 | } 147 | void Wait(uv_mutex_t* mutex) 148 | { 149 | uv_cond_wait(&cond_, mutex); 150 | } 151 | int Wait(CUVMutex* mutex, uint64_t timeout) 152 | { 153 | return uv_cond_timedwait(&cond_, &mutex->mut_, timeout); 154 | } 155 | int Wait(uv_mutex_t* mutex, uint64_t timeout) 156 | { 157 | return uv_cond_timedwait(&cond_, mutex, timeout); 158 | } 159 | private: 160 | uv_cond_t cond_; 161 | private://private中,禁止复制和赋值 162 | CUVCond(const CUVCond&);//不实现 163 | CUVCond& operator =(const CUVCond&);//不实现 164 | }; 165 | 166 | //信号量 167 | class CUVSem 168 | { 169 | public: 170 | explicit CUVSem(int initValue = 0) 171 | { 172 | uv_sem_init(&sem_, initValue); 173 | } 174 | ~CUVSem(void) 175 | { 176 | uv_sem_destroy(&sem_); 177 | } 178 | void Post() 179 | { 180 | uv_sem_post(&sem_); 181 | } 182 | void Wait() 183 | { 184 | uv_sem_wait(&sem_); 185 | } 186 | bool TryWait() 187 | { 188 | return uv_sem_trywait(&sem_) == 0; 189 | } 190 | private: 191 | uv_sem_t sem_; 192 | private://private中,禁止复制和赋值 193 | CUVSem(const CUVSem&);//不实现 194 | CUVSem& operator =(const CUVSem&);//不实现 195 | }; 196 | 197 | //读写锁 198 | class CUVRWLock 199 | { 200 | public: 201 | explicit CUVRWLock() 202 | { 203 | uv_rwlock_init(&rwlock_); 204 | } 205 | ~CUVRWLock(void) 206 | { 207 | uv_rwlock_destroy(&rwlock_); 208 | } 209 | void ReadLock() 210 | { 211 | uv_rwlock_rdlock(&rwlock_); 212 | } 213 | void ReadUnLock() 214 | { 215 | uv_rwlock_rdunlock(&rwlock_); 216 | } 217 | bool ReadTryLock() 218 | { 219 | return uv_rwlock_tryrdlock(&rwlock_) == 0; 220 | } 221 | void WriteLock() 222 | { 223 | uv_rwlock_wrlock(&rwlock_); 224 | } 225 | void WriteUnLock() 226 | { 227 | uv_rwlock_wrunlock(&rwlock_); 228 | } 229 | bool WriteTryLock() 230 | { 231 | return uv_rwlock_trywrlock(&rwlock_) == 0; 232 | } 233 | private: 234 | uv_rwlock_t rwlock_; 235 | private://private中,禁止复制和赋值 236 | CUVRWLock(const CUVRWLock&);//不实现 237 | CUVRWLock& operator =(const CUVRWLock&);//不实现 238 | }; 239 | 240 | 241 | class CUVBarrier 242 | { 243 | public: 244 | explicit CUVBarrier(int count) 245 | { 246 | uv_barrier_init(&barrier_, count); 247 | } 248 | ~CUVBarrier(void) 249 | { 250 | uv_barrier_destroy(&barrier_); 251 | } 252 | void Wait() 253 | { 254 | uv_barrier_wait(&barrier_); 255 | } 256 | private: 257 | uv_barrier_t barrier_; 258 | private://private中,禁止复制和赋值 259 | CUVBarrier(const CUVBarrier&);//不实现 260 | CUVBarrier& operator =(const CUVBarrier&);//不实现 261 | }; 262 | 263 | typedef void (*entry)(void* arg); 264 | class CUVThread 265 | { 266 | public: 267 | explicit CUVThread(entry fun, void* arg) 268 | : fun_(fun), arg_(arg), isrunning_(false) 269 | { 270 | 271 | } 272 | ~CUVThread(void) 273 | { 274 | if (isrunning_) { 275 | uv_thread_join(&thread_); 276 | } 277 | isrunning_ = false; 278 | } 279 | void Start() 280 | { 281 | if (isrunning_) { 282 | return; 283 | } 284 | uv_thread_create(&thread_, fun_, arg_); 285 | isrunning_ = true; 286 | } 287 | void Stop() 288 | { 289 | if (!isrunning_) { 290 | return; 291 | } 292 | uv_thread_join(&thread_); 293 | isrunning_ = false; 294 | } 295 | void Sleep(int64_t millsec) 296 | { 297 | uv_thread_sleep(millsec); 298 | } 299 | int GetThreadID(void) const 300 | { 301 | return uv_thread_id(); 302 | } 303 | bool IsRunning(void) const 304 | { 305 | return isrunning_; 306 | } 307 | private: 308 | uv_thread_t thread_; 309 | entry fun_; 310 | void* arg_; 311 | bool isrunning_; 312 | }; 313 | #endif //COMMON_THREAD_UV_H 314 | -------------------------------------------------------------------------------- /tcpclient.h: -------------------------------------------------------------------------------- 1 | /*************************************** 2 | * @file tcpclient.h 3 | * @brief 基于libuv封装的tcp服务器与客户端,使用log4z作日志工具 4 | * @details 5 | * @author phata, wqvbjhc@gmail.com 6 | * @date 2014-05-13 7 | * @mod 2014-05-13 phata 修正服务器与客户端的错误.现服务器支持多客户端连接 8 | 修改客户端测试代码,支持并发多客户端测试 9 | 2014-05-23 phata 原服务器与客户端只接收裸数据,现改为接收NetPacket(定义net_base.h)封装的数据。接收回调为解析后的数据,但发送需要用户自己封闭成NetPacket后发送 10 | 修改server_recvcb的定义,添加NetPacket参数 11 | 修改client_recvcb的定义,添加NetPacket参数 12 | 申请uv_write_t列表空间用于send 13 | 2014-05-27 phata clientdata更名为AcceptClient,并丰富了其功能. 14 | 使用异步发送机制,可以在其他线程中调用服务器与客户端的send函数 15 | 修改之前测试发现崩溃的情况 16 | BUFFER_SIZE由1M改为10K,一个client需要6倍BUFFER_SIZE.一个client内部会启动2个线程 17 | 2014-07-24 phata 从tcpsocket中分离出TCPClient。 18 | 单独线程实现libuv的run(事件循环),任何libuv相关操作都在此线程中完成。因此TCPClient可以多线程中任意调用 19 | 一个client需要4倍BUFFER_SIZE(readbuffer_,writebuffer_,writebuf_list_,readpacket_),启动两个线程(readpacket_内部一个,Connect启动一个) 20 | 2014-11-01 phata 由于运行起来CPU负荷高,决定改进: 21 | 1.去掉prepare,check,idle事件 22 | 2.prepare里的判断用户关闭tcp和发送数据由uv_async_send代替 23 | 3.prepare里的删除多余空闲handle,write_t不需要。回收空闲handle,write_t时判断是否多出预计,多时不回收,直接释放。 24 | 2014-11-16 phata 修改发送数据uv_async_send逻辑,现在发送不延时 25 | 2015-01-06 phata 使用uv_walk关闭各handle,整个loop关闭回调在run返回后触发。 26 | 加入断线重连功能 27 | ****************************************/ 28 | #ifndef TCPCLIENT_H 29 | #define TCPCLIENT_H 30 | #include 31 | #include 32 | #include "uv.h" 33 | #include "net/packet_sync.h" 34 | #include "pod_circularbuffer.h" 35 | #ifndef BUFFER_SIZE 36 | #define BUFFER_SIZE (1024*10) 37 | #endif 38 | 39 | namespace uv 40 | { 41 | /**********************************************Client****************************************************/ 42 | typedef struct _tcpclient_ctx { 43 | uv_tcp_t tcphandle;//store this on data 44 | uv_write_t write_req;//store this on data 45 | PacketSync* packet_;//store this on userdata 46 | uv_buf_t read_buf_; 47 | int clientid; 48 | void* parent_server;//store TCPClient point 49 | } TcpClientCtx; 50 | TcpClientCtx* AllocTcpClientCtx(void* parentserver); 51 | void FreeTcpClientCtx(TcpClientCtx* ctx); 52 | 53 | typedef struct _write_param{//param of uv_write 54 | uv_write_t write_req_;//store TCPClient on data 55 | uv_buf_t buf_; 56 | int buf_truelen_; 57 | }write_param; 58 | write_param * AllocWriteParam(void); 59 | void FreeWriteParam(write_param* param); 60 | 61 | /************************************************* 62 | Fun: TCP Client 63 | Usage: 64 | Start the log fun(optional): StartLog 65 | Set the call back fun : SetRecvCB/SetClosedCB/SetReconnectCB 66 | Connect Server : Connect/Connect6 67 | SetNoDelay(optional) : SetNoDelay 68 | SetKeepAlive(optional) : SetKeepAlive 69 | Send data : Send 70 | Close Server : Close. this fun only set the close command, call IsClosed to verify real closed. 71 | or verify in the call back fun which SetRecvCB set. 72 | Stop the log fun(optional) : StopLog 73 | GetLastErrMsg(optional) : when the above fun call failure, call this fun to get the error message. 74 | *************************************************/ 75 | class TCPClient 76 | { 77 | public: 78 | TCPClient(char packhead, char packtail); 79 | virtual ~TCPClient(); 80 | //Start/Stop the log 81 | static void StartLog(const char* logpath = nullptr); 82 | static void StopLog(); 83 | public: 84 | void SetRecvCB(ClientRecvCB pfun, void* userdata);//set recv cb 85 | void SetClosedCB(TcpCloseCB pfun, void* userdata);//set close cb. 86 | void SetReconnectCB(ReconnectCB pfun, void* userdata);//set reconnect cb 87 | bool Connect(const char* ip, int port);//connect the server, ipv4 88 | bool Connect6(const char* ip, int port);//connect the server, ipv6 89 | int Send(const char* data, std::size_t len);//send data to server 90 | void Close();//send close command. verify IsClosed for real closed 91 | bool IsClosed() {//verify if real closed 92 | return isclosed_; 93 | }; 94 | //Enable or disable Nagle’s algorithm. must call after Server succeed start. 95 | bool SetNoDelay(bool enable); 96 | 97 | //Enable or disable KeepAlive. must call after Server succeed start. 98 | //delay is the initial delay in seconds, ignored when enable is zero 99 | bool SetKeepAlive(int enable, unsigned int delay); 100 | 101 | const char* GetLastErrMsg() const { 102 | return errmsg_.c_str(); 103 | }; 104 | protected: 105 | bool init(); 106 | void closeinl();//real close fun 107 | bool run(int status = UV_RUN_DEFAULT); 108 | void send_inl(uv_write_t* req = NULL);//real send data fun 109 | static void ConnectThread(void* arg);//connect thread,run until use close the client 110 | 111 | static void AfterConnect(uv_connect_t* handle, int status); 112 | static void AfterRecv(uv_stream_t* client, ssize_t nread, const uv_buf_t* buf); 113 | static void AfterSend(uv_write_t* req, int status); 114 | static void AllocBufferForRecv(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf); 115 | static void AfterClientClose(uv_handle_t* handle); 116 | static void AsyncCB(uv_async_t* handle);//async close 117 | static void CloseWalkCB(uv_handle_t* handle, void* arg);//close all handle in loop 118 | static void GetPacket(const NetPacket& packethead, const unsigned char* packetdata, void* userdata); 119 | static void ReconnectTimer(uv_timer_t* handle); 120 | 121 | private: 122 | enum { 123 | CONNECT_TIMEOUT, 124 | CONNECT_FINISH, 125 | CONNECT_ERROR, 126 | CONNECT_DIS, 127 | }; 128 | TcpClientCtx *client_handle_; 129 | uv_async_t async_handle_; 130 | uv_loop_t loop_; 131 | bool isclosed_; 132 | bool isuseraskforclosed_; 133 | 134 | uv_thread_t connect_threadhandle_; 135 | uv_connect_t connect_req_; 136 | 137 | int connectstatus_; 138 | 139 | //send param 140 | uv_mutex_t mutex_writebuf_;//mutex of writebuf_list_ 141 | std::list writeparam_list_;//Availa write_t 142 | PodCircularBuffer write_circularbuf_;//the data prepare to send 143 | 144 | ClientRecvCB recvcb_; 145 | void* recvcb_userdata_; 146 | 147 | TcpCloseCB closedcb_; 148 | void* closedcb_userdata_; 149 | 150 | ReconnectCB reconnectcb_; 151 | void* reconnect_userdata_; 152 | bool StartReconnect(void); 153 | void StopReconnect(void); 154 | uv_timer_t reconnect_timer_; 155 | bool isreconnecting_; 156 | int64_t repeat_time_;//repeat reconnect time. y=2x(x=1..) 157 | 158 | std::string connectip_; 159 | int connectport_; 160 | bool isIPv6_; 161 | std::string errmsg_; 162 | 163 | char PACKET_HEAD;//protocol head 164 | char PACKET_TAIL;//protocol tail 165 | }; 166 | } 167 | 168 | #endif // TCPCLIENT_H -------------------------------------------------------------------------------- /tcpserverprotocolprocess.h: -------------------------------------------------------------------------------- 1 | /*************************************** 2 | * @file tcpserverprotocolprocess.h 3 | * @brief TCP Server protocol pure base class,need to subclass. 4 | * @details 5 | * @author phata, wqvbjhc@gmail.com 6 | * @date 2014-7-31 7 | ****************************************/ 8 | #ifndef TCP_SERVER_PROTOCOL_PROCESS_H 9 | #define TCP_SERVER_PROTOCOL_PROCESS_H 10 | #include 11 | 12 | class TCPServerProtocolProcess 13 | { 14 | public: 15 | TCPServerProtocolProcess(){} 16 | virtual ~TCPServerProtocolProcess(){} 17 | 18 | //parse the recv packet, and make the response packet return. see test_tcpserver.cpp for example 19 | //packet : the recv packet 20 | //buf : the packet data 21 | //std::string: the response packet. no response can't return empty string. 22 | virtual const std::string& ParsePacket(const NetPacket& packet, const unsigned char* buf) = 0; 23 | }; 24 | 25 | #endif//TCP_SERVER_PROTOCOL_PROCESS_H -------------------------------------------------------------------------------- /test_tcpclient.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "tcpclient.h" 4 | using namespace std; 5 | using namespace uv; 6 | 7 | std::string serverip; 8 | int call_time = 0; 9 | bool is_exist = false; 10 | 11 | void CloseCB(int clientid, void* userdata) 12 | { 13 | fprintf(stdout, "cliend %d close\n", clientid); 14 | TCPClient* client = (TCPClient*)userdata; 15 | client->Close(); 16 | } 17 | 18 | void ReadCB(const NetPacket& packet, const unsigned char* buf, void* userdata) 19 | { 20 | fprintf(stdout,"call time %d\n",++call_time); 21 | if (call_time > 5000) { 22 | return; 23 | } 24 | char senddata[256] = {0}; 25 | TCPClient* client = (TCPClient*)userdata; 26 | sprintf(senddata, "****recv server data(%p,%d)", client, packet.datalen); 27 | fprintf(stdout, "%s\n", senddata); 28 | NetPacket tmppack = packet; 29 | tmppack.datalen = (std::min)(strlen(senddata), sizeof(senddata) - 1); 30 | std::string retstr = PacketData(tmppack, (const unsigned char*)senddata); 31 | if (client->Send(&retstr[0], retstr.length()) <= 0) { 32 | fprintf(stdout, "(%p)send error.%s\n", client, client->GetLastErrMsg()); 33 | } 34 | } 35 | 36 | int main(int argc, char** argv) 37 | { 38 | if (argc != 3) { 39 | fprintf(stdout, "usage: %s server_ip_address clientcount\neg.%s 192.168.1.1 50\n", argv[0], argv[0]); 40 | return 0; 41 | } 42 | serverip = argv[1]; 43 | 44 | const int clientsize = std::stoi(argv[2]); 45 | TCPClient** pClients = new TCPClient*[clientsize]; 46 | TCPClient::StartLog("log/"); 47 | 48 | int i = 0; 49 | char senddata[256]; 50 | for (int i = 0; i < clientsize; ++i) { 51 | pClients[i] = new TCPClient(0x01, 0x02); 52 | pClients[i]->SetRecvCB(ReadCB, pClients[i]); 53 | pClients[i]->SetClosedCB(CloseCB, pClients[i]); 54 | if (!pClients[i]->Connect(serverip.c_str(), 12345)) { 55 | fprintf(stdout, "connect error:%s\n", pClients[i]->GetLastErrMsg()); 56 | } else { 57 | fprintf(stdout, "client(%p) connect succeed.\n", pClients[i]); 58 | } 59 | memset(senddata, 0, sizeof(senddata)); 60 | sprintf(senddata, "client(%p) call %d", pClients[i], ++call_time); 61 | NetPacket packet; 62 | packet.header = 0x01; 63 | packet.tail = 0x02; 64 | packet.datalen = (std::min)(strlen(senddata), sizeof(senddata) - 1); 65 | std::string str = PacketData(packet, (const unsigned char*)senddata); 66 | if (pClients[i]->Send(&str[0], str.length()) <= 0) { 67 | fprintf(stdout, "(%p)send error.%s\n", pClients[i], pClients[i]->GetLastErrMsg()); 68 | } else { 69 | //fprintf(stdout,"发送的数据为:\n"); 70 | // for (int i=0; i 2 | #include 3 | #include "tcpclient.h" 4 | using namespace std; 5 | using namespace uv; 6 | 7 | std::string serverip; 8 | int call_time = 0; 9 | bool is_exist = false; 10 | 11 | void CloseCB(int clientid, void* userdata) 12 | { 13 | fprintf(stdout, "cliend close\n"); 14 | TCPClient* client = (TCPClient*)userdata; 15 | client->Close(); 16 | } 17 | 18 | void ReadCB(const NetPacket& packet, const unsigned char* buf, void* userdata) 19 | { 20 | char senddata[256] = {0}; 21 | TCPClient* client = (TCPClient*)userdata; 22 | sprintf(senddata, "****recv server data(%p,%d)", client, packet.datalen); 23 | fprintf(stdout, "%s\n", senddata); 24 | NetPacket tmppack = packet; 25 | tmppack.datalen = (std::min)(strlen(senddata), sizeof(senddata) - 1); 26 | std::string retstr = PacketData(tmppack, (const unsigned char*)senddata); 27 | if (client->Send(&retstr[0], retstr.length()) <= 0) { 28 | fprintf(stdout, "(%p)send error.%s\n", client, client->GetLastErrMsg()); 29 | } 30 | fprintf(stdout, "call time %d\n", ++call_time); 31 | //if (call_time > 50) { 32 | // is_exist = true; 33 | //} 34 | } 35 | void ReConnectCB(NET_EVENT_TYPE eventtype, void* userdata) 36 | { 37 | TCPClient* client = (TCPClient*)userdata; 38 | if (NET_EVENT_TYPE_RECONNECT == eventtype) { 39 | fprintf(stdout, "succeed reconnect.\n"); 40 | char senddata[256]; 41 | memset(senddata, 0, sizeof(senddata)); 42 | sprintf(senddata, "client(%p) call %d", client, ++call_time); 43 | NetPacket packet; 44 | packet.header = 0x01; 45 | packet.tail = 0x02; 46 | packet.datalen = (std::min)(strlen(senddata), sizeof(senddata) - 1); 47 | std::string str = PacketData(packet, (const unsigned char*)senddata); 48 | if (client->Send(&str[0], str.length()) <= 0) { 49 | fprintf(stdout, "(%p)send error.%s\n", client, client->GetLastErrMsg()); 50 | } else { 51 | fprintf(stdout, "send succeed:%s\n", senddata); 52 | } 53 | } else { 54 | fprintf(stdout, "server disconnect.\n"); 55 | } 56 | } 57 | 58 | int main(int argc, char** argv) 59 | { 60 | if (argc != 3) { 61 | fprintf(stdout, "usage: %s server_ip_address clientcount\neg.%s 192.168.1.1 50\n", argv[0], argv[0]); 62 | return 0; 63 | } 64 | serverip = argv[1]; 65 | 66 | const int clientsize = std::stoi(argv[2]); 67 | TCPClient pClients(0x01, 0x02); 68 | TCPClient::StartLog("log/"); 69 | 70 | int i = 0; 71 | char senddata[256]; 72 | pClients.SetRecvCB(ReadCB, &pClients); 73 | pClients.SetClosedCB(CloseCB, &pClients); 74 | pClients.SetReconnectCB(ReConnectCB, &pClients); 75 | if (!pClients.Connect(serverip.c_str(), 12345)) { 76 | fprintf(stdout, "connect error:%s\n", pClients.GetLastErrMsg()); 77 | } else { 78 | fprintf(stdout, "client(%p) connect succeed.\n", &pClients); 79 | } 80 | memset(senddata, 0, sizeof(senddata)); 81 | sprintf(senddata, "client(%p) call %d", &pClients, ++call_time); 82 | NetPacket packet; 83 | packet.header = 0x01; 84 | packet.tail = 0x02; 85 | packet.datalen = (std::min)(strlen(senddata), sizeof(senddata) - 1); 86 | std::string str = PacketData(packet, (const unsigned char*)senddata); 87 | if (pClients.Send(&str[0], str.length()) <= 0) { 88 | fprintf(stdout, "(%p)send error.%s\n", &pClients, pClients.GetLastErrMsg()); 89 | } else { 90 | fprintf(stdout, "send succeed:%s\n", senddata); 91 | } 92 | while (!is_exist) { 93 | uv_thread_sleep(1000); 94 | } 95 | return 0; 96 | } -------------------------------------------------------------------------------- /test_tcpserver.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "tcpserver.h" 4 | class TestTCPProtocol: public TCPServerProtocolProcess 5 | { 6 | public: 7 | TestTCPProtocol(){} 8 | virtual ~TestTCPProtocol(){} 9 | virtual const std::string& ParsePacket(const NetPacket& packet, const unsigned char* buf){ 10 | static char senddata[256]; 11 | sprintf(senddata,"****recv datalen %d",packet.datalen); 12 | fprintf(stdout,"%s\n",senddata); 13 | 14 | NetPacket tmppack = packet; 15 | tmppack.datalen = (std::min)(strlen(senddata),sizeof(senddata)-1); 16 | pro_packet_ = PacketData(tmppack,(const unsigned char*)senddata); 17 | return pro_packet_; 18 | } 19 | private: 20 | std::string pro_packet_; 21 | }; 22 | 23 | using namespace std; 24 | using namespace uv; 25 | bool is_eist = false; 26 | int call_time = 0; 27 | 28 | TCPServer server(0x01,0x02); 29 | 30 | void CloseCB(int clientid, void* userdata) 31 | { 32 | fprintf(stdout,"cliend %d close\n",clientid); 33 | TCPServer *theclass = (TCPServer *)userdata; 34 | //is_eist = true; 35 | } 36 | 37 | void NewConnect(int clientid, void* userdata) 38 | { 39 | fprintf(stdout,"new connect:%d\n",clientid); 40 | server.SetRecvCB(clientid,NULL,NULL); 41 | } 42 | 43 | int main(int argc, char** argv) 44 | { 45 | TestTCPProtocol protocol; 46 | TCPServer::StartLog("log/"); 47 | server.SetNewConnectCB(NewConnect,&server); 48 | server.SetPortocol(&protocol); 49 | if(!server.Start("0.0.0.0",12345)) { 50 | fprintf(stdout,"Start Server error:%s\n",server.GetLastErrMsg()); 51 | } 52 | server.SetKeepAlive(1,60);//enable Keepalive, 60s 53 | fprintf(stdout,"server return on main.\n"); 54 | while(!is_eist) { 55 | uv_thread_sleep(1000); 56 | } 57 | return 0; 58 | } --------------------------------------------------------------------------------