Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support TLS in Webternet. #1856

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@
path = sourcepawn
url = https://github.com/alliedmodders/sourcepawn
shallow = true
[submodule "extensions/curl/curl-src"]
path = extensions/curl/curl-src
url = https://github.com/curl/curl
shallow = true
[submodule "extensions/curl/mbedtls-src"]
path = extensions/curl/mbedtls-src
url = https://github.com/Mbed-TLS/mbedtls
shallow = true
3,506 changes: 3,506 additions & 0 deletions configs/ca-bundle.crt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,93 +8,116 @@ for cxx in builder.targets:
binary = SM.StaticLibrary(builder, cxx, 'curl')
binary.compiler.includes += [
os.path.join(builder.sourcePath, 'extensions', 'curl', 'curl-src', 'lib'),
os.path.join(builder.sourcePath, 'extensions', 'curl', 'curl-src', 'include')
os.path.join(builder.sourcePath, 'extensions', 'curl', 'curl-src', 'include'),
os.path.join(builder.sourcePath, 'extensions', 'curl', 'mbedtls-src', 'include')
]

binary.compiler.defines += [
'BUILDING_LIBCURL',
'CURL_STATICLIB',
]

if binary.compiler.target.platform == 'mac':
mac_version, ignore, ignore = platform.mac_ver()
mac_tuple = mac_version.split('.')
if int(mac_tuple[0]) >= 10 and int(mac_tuple[1]) >= 9:
binary.compiler.defines += ['BUILTIN_STRLCAT']
elif binary.compiler.target.platform == 'windows':
binary.compiler.defines += [
'BUILDING_LIBCURL',
'CURL_STATICLIB',
'CURL_DISABLE_LDAP',
]
elif binary.compiler.target.platform == 'linux':
binary.compiler.defines += ['_GNU_SOURCE']
binary.compiler.cflags += ['-Wno-constant-conversion']

if binary.compiler.family == 'clang':
# https://llvm.org/bugs/show_bug.cgi?id=16428
binary.compiler.cflags += ['-Wno-attributes']

binary.sources += [
#LIB_CFILES
'altsvc.c',
'asyn-thread.c',
'base64.c',
'bufref.c',
'conncache.c',
'connect.c',
'content_encoding.c',
'cookie.c',
'curl_addrinfo.c',
'dict.c',
'curl_endian.c',
'curl_fnmatch.c',
'curl_get_line.c',
'curl_gethostname.c',
'curl_memrchr.c',
'curl_multibyte.c',
'curl_path.c',
'curl_range.c',
'curl_threads.c',
'doh.c',
'dynbuf.c',
'easy.c',
'easygetopt.c',
'easyoptions.c',
'escape.c',
'file.c',
'fileinfo.c',
'fopen.c',
'formdata.c',
'ftp.c',
'getenv.c',
'getinfo.c',
'gtls.c',
'hash.c',
'hostares.c',
'headers.c',
'hostasyn.c',
'hostip.c',
'hostip4.c',
'hostip6.c',
'hostsyn.c',
'hostthre.c',
'hsts.c',
'http.c',
'http_chunks.c',
'http_digest.c',
'http_negotiate.c',
'http_ntlm.c',
'http_proxy.c',
'if2ip.c',
'inet_ntop.c',
'inet_pton.c',
'krb4.c',
'krb5.c',
'ldap.c',
'llist.c',
'md5.c',
'memdebug.c',
'mime.c',
'mprintf.c',
'multi.c',
'netrc.c',
'nss.c',
'nonblock.c',
'noproxy.c',
'parsedate.c',
'progress.c',
'qssl.c',
'rawstr.c',
'security.c',
'rand.c',
'rename.c',
'select.c',
'sendf.c',
'setopt.c',
'sha256.c',
'share.c',
'socks.c',
'slist.c',
'speedcheck.c',
'splay.c',
'ssh.c',
'sslgen.c',
'ssluse.c',
'strcase.c',
'strdup.c',
'strequal.c',
'strerror.c',
'strtok.c',
'strtoofft.c',
'telnet.c',
'tftp.c',
'timediff.c',
'timeval.c',
'transfer.c',
'url.c',
'version.c'
'urlapi.c',
'version.c',
'warnless.c',

#LIB_VTLS_CFILES
'vtls/mbedtls.c',
'vtls/mbedtls_threadlock.c',
'vtls/vtls.c',

# LIB_VAUTH_CFILES
'vauth/vauth.c',
]
rvalue[binary.compiler.target.arch] = builder.Add(binary)

if binary.compiler.target.platform == 'windows':
binary.sources += [
'system_win32.c',
'version_win32.c',
]

rvalue[binary.compiler.target.arch] = builder.Add(binary)
114 changes: 114 additions & 0 deletions extensions/curl/AMBuild/AMBuilder.mbedtls
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# vim: sts=2 ts=8 sw=2 tw=99 et ft=python:
import os, platform

builder.SetBuildFolder('mbedtls')

rvalue = {}
for cxx in builder.targets:
binary = SM.StaticLibrary(builder, cxx, 'mbedtls')
binary.compiler.includes += [
os.path.join(builder.sourcePath, 'extensions', 'curl', 'mbedtls-src', 'include'),
os.path.join(builder.sourcePath, 'extensions', 'curl', 'mbedtls-src', 'library'),
]

binary.compiler.defines += ['USE_STATIC_MBEDTLS_LIBRARY']

binary.sources += [
'aes.c',
'aesni.c',
'aria.c',
'asn1parse.c',
'asn1write.c',
'base64.c',
'bignum.c',
'camellia.c',
'ccm.c',
'chacha20.c',
'chachapoly.c',
'cipher.c',
'cipher_wrap.c',
'constant_time.c',
'cmac.c',
'ctr_drbg.c',
'des.c',
'dhm.c',
'ecdh.c',
'ecdsa.c',
'ecjpake.c',
'ecp.c',
'ecp_curves.c',
'entropy.c',
'entropy_poll.c',
'error.c',
'gcm.c',
'hkdf.c',
'hmac_drbg.c',
'md.c',
'md5.c',
'memory_buffer_alloc.c',
'mps_reader.c',
'mps_trace.c',
'nist_kw.c',
'oid.c',
'padlock.c',
'pem.c',
'pk.c',
'pk_wrap.c',
'pkcs12.c',
'pkcs5.c',
'pkparse.c',
'pkwrite.c',
'platform.c',
'platform_util.c',
'poly1305.c',
'psa_crypto.c',
'psa_crypto_aead.c',
'psa_crypto_cipher.c',
'psa_crypto_client.c',
'psa_crypto_driver_wrappers.c',
'psa_crypto_ecp.c',
'psa_crypto_hash.c',
'psa_crypto_mac.c',
'psa_crypto_rsa.c',
'psa_crypto_se.c',
'psa_crypto_slot_management.c',
'psa_crypto_storage.c',
'psa_its_file.c',
'ripemd160.c',
'rsa.c',
'rsa_alt_helpers.c',
'sha1.c',
'sha256.c',
'sha512.c',
'ssl_debug_helpers_generated.c',
'threading.c',
'timing.c',
'version.c',
'version_features.c',

'x509.c',
'x509_create.c',
'x509_crl.c',
'x509_crt.c',
'x509_csr.c',
'x509write_crt.c',
'x509write_csr.c',

'debug.c',
'net_sockets.c',
'ssl_cache.c',
'ssl_ciphersuites.c',
'ssl_client.c',
'ssl_cookie.c',
'ssl_msg.c',
'ssl_ticket.c',
'ssl_tls.c',
'ssl_tls12_client.c',
'ssl_tls12_server.c',
'ssl_tls13_keys.c',
'ssl_tls13_server.c',
'ssl_tls13_client.c',
'ssl_tls13_generic.c',
]

rvalue[binary.compiler.target.arch] = builder.Add(binary)
Loading