This commit is contained in:
Vladimir Dubrovin committed 2021-10-21 19:57:06 +03:00
commit daa2b74354
69 files changed
+277 -156

No files matched your search

+6 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
@@ -12,6 +12,11 @@
#ifndef NOPLUGINS
#include <dlfcn.h>
#endif
#else
#ifdef WITH_SSL
#include <openssl/applink.c>
#endif
#endif
#ifndef DEFAULTCONFIG
+1 -1
View File
@@ -10,7 +10,7 @@ BEGIN
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "Comments", "3proxy - tiny proxy server, http://3proxy.org/\0"
VALUE "Comments", "3proxy - tiny proxy server, https://3proxy.org/\0"
VALUE "CompanyName", "Vladimir Dubrovin\0"
VALUE "FileDescription", "3proxy - tiny proxy server\0"
VALUE "FileVersion", RELEASE3PROXY
+1 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+5 -2
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2000-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2000-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
@@ -655,8 +655,11 @@ CLEANRET:
}
int radauth(struct clientparam * param){
int res;
/*radsend(param, 0, 0);*/
return radsend(param, 1, 0);
res = radsend(param, 1, 0);
if(!res && param->srv->logfunc == logradius)radsend(param, 0, 0);
return res;
}
void logradius(struct clientparam * param, const unsigned char *s) {
+1 -1
View File
@@ -1,5 +1,5 @@
/*
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+1 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+1 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+1 -1
View File
@@ -1,5 +1,5 @@
/*
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+1 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+1 -1
View File
@@ -1,5 +1,5 @@
/*
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+1 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+1 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2020 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+1 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+1 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+1 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+1 -2
View File
@@ -1,6 +1,5 @@
/*
3APA3A simpliest proxy server
(c) 2007-2008 by ZARAZA <3APA3A@security.nnov.ru>
(c) 2007-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+1 -2
View File
@@ -1,6 +1,5 @@
/*
3APA3A simpliest proxy server
(c) 2007-2008 by ZARAZA <3APA3A@security.nnov.ru>
(c) 2007-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+46 -29
View File
@@ -1,3 +1,9 @@
/*
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
*/
#define _CRT_SECURE_NO_WARNINGS
@@ -14,9 +20,6 @@
#include <openssl/pem.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#ifdef WIN32
#include <openssl/applink.c>
#endif
#include "../../proxy.h"
#include "my_ssl.h"
@@ -104,7 +107,7 @@ void del_ext(X509 *dst_cert, int nid, int where){
SSL_CERT ssl_copy_cert(SSL_CERT cert)
{
int err = -1;
FILE *fcache;
BIO *fcache;
X509 *src_cert = (X509 *) cert;
X509 *dst_cert = NULL;
@@ -129,16 +132,16 @@ SSL_CERT ssl_copy_cert(SSL_CERT cert)
bin2hex(hash_sha1, 20, hash_name_sha1, sizeof(hash_name_sha1));
sprintf(cache_name, "%s%s.pem", cert_path, hash_name_sha1);
/* check if certificate is already cached */
fcache = fopen(cache_name, "rb");
fcache = BIO_new_file(cache_name, "rb");
if ( fcache != NULL ) {
#ifndef _WIN32
flock(fileno(fcache), LOCK_SH);
flock(BIO_get_fd(fcache, NULL), LOCK_SH);
#endif
dst_cert = PEM_read_X509(fcache, &dst_cert, NULL, NULL);
dst_cert = PEM_read_bio_X509(fcache, &dst_cert, NULL, NULL);
#ifndef _WIN32
flock(fileno(fcache), LOCK_UN);
flock(BIO_get_fd(fcache, NULL), LOCK_UN);
#endif
fclose(fcache);
BIO_free(fcache);
if ( dst_cert != NULL ){
return dst_cert;
}
@@ -174,16 +177,16 @@ SSL_CERT ssl_copy_cert(SSL_CERT cert)
/* write to cache */
fcache = fopen(cache_name, "wb");
fcache = BIO_new_file(cache_name, "wb");
if ( fcache != NULL ) {
#ifndef _WIN32
flock(fileno(fcache), LOCK_EX);
flock(BIO_get_fd(fcache, NULL), LOCK_EX);
#endif
PEM_write_X509(fcache, dst_cert);
PEM_write_bio_X509(fcache, dst_cert);
#ifndef _WIN32
flock(fileno(fcache), LOCK_UN);
flock(BIO_get_fd(fcache, NULL), LOCK_UN);
#endif
fclose(fcache);
BIO_free(fcache);
}
return dst_cert;
}
@@ -414,50 +417,64 @@ int ssl_file_init = 0;
void ssl_init(void)
{
FILE *f;
BIO *f;
static char fname[200];
if(!ssl_file_init++)pthread_mutex_init(&ssl_file_mutex, NULL);
pthread_mutex_lock(&ssl_file_mutex);
thread_setup();
SSLeay_add_ssl_algorithms();
SSL_load_error_strings();
sprintf(fname, "%.128s3proxy.pem", cert_path);
f = fopen(fname, "r");
f = BIO_new_file(fname, "r");
if ( f != NULL ) {
PEM_read_X509(f, &CA_cert, NULL, NULL);
fclose(f);
if(!(CA_cert=PEM_read_bio_X509(f, NULL, NULL, NULL))){
unsigned long err;
err=ERR_get_error();
fprintf(stderr, "failed to read: %s: [%lu] %s\n", fname, err, ERR_error_string(err, NULL));
return;
}
BIO_free(f);
}
else {
fprintf(stderr, "failed to open: %s\n", fname);
return;
}
name = X509_get_subject_name(CA_cert);
sprintf(fname, "%.128s3proxy.key", cert_path);
f = fopen(fname, "rb");
f = BIO_new_file(fname, "rb");
if ( f != NULL ) {
CA_key = PEM_read_PrivateKey(f, &CA_key, NULL, NULL);
fclose(f);
CA_key = PEM_read_bio_PrivateKey(f, NULL, NULL, NULL);
if(!CA_key){
unsigned long err;
err=ERR_get_error();
fprintf(stderr, "failed to read: %s: [%lu] %s\n", fname, err, ERR_error_string(err, NULL));
return;
}
BIO_free(f);
}
else {
fprintf(stderr, "failed to open: %s\n", fname);
return;
}
sprintf(fname, "%.128sserver.key", cert_path);
f = fopen(fname, "rb");
f = BIO_new_file(fname, "rb");
if ( f != NULL ) {
server_key = PEM_read_PrivateKey(f, &server_key, NULL, NULL);
fclose(f);
server_key = PEM_read_bio_PrivateKey(f, &server_key, NULL, NULL);
if(!server_key){
unsigned long err;
err=ERR_get_error();
fprintf(stderr, "failed to read: %s: [%lu] %s\n", fname, err, ERR_error_string(err, NULL));
return;
}
BIO_free(f);
}
else {
fprintf(stderr, "failed to open: %s\n", fname);
}
if(!CA_cert || !CA_key || !server_key){
fprintf(stderr, "failed to init SSL certificate / keys\n");
}
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
pthread_mutex_unlock(&ssl_file_mutex);
+1 -2
View File
@@ -1,6 +1,5 @@
/*
3APA3A simpliest proxy server
(c) 2007-2008 by ZARAZA <3APA3A@security.nnov.ru>
(c) 2007-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2017 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
@@ -1,6 +1,5 @@
/*
3APA3A simpliest proxy server
(c) 2007-2008 by ZARAZA <3APA3A@security.nnov.ru>
(c) 2007-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
-31
View File
@@ -1,31 +0,0 @@
3proxy 0.6 Windows Authentication Plugin Public License Agreement
This software provided "as is" without any guaranties or support.
This software is FREEWARE. You can use it under terms of current version
of GNU GPL (General Public License) available from
http://www.gnu.org/licenses/gpl.txt or under conditions below:
1. You are granted non-exclusive rights to compile, modify, use and
re-distribute this program.
2. In case this software is redistributed in binary form, source code
MUST be available for user for free.
3. In case this software redistributed embedded in hardware device or
pre-installed version of operation system and source code is not available,
documentation MUST refer to http://www.security.nnov.ru/ as a source of
software.
4. In case this software is modified or is used as a part of another project
license MUST NOT be modified.
5. Authors of this software MAY change terms of this license for future
versions of this product.
(c) 2000-2009 by 3APA3A (3APA3A@security.nnov.ru)
(c) 2000-2009 by SECURITY.NNOV (http://www.security.nnov.ru)
(c) 2000-2009 by Vladimir Dubrovin (vlad@sandy.ru)
This software uses:
RSA Data Security, Inc. MD4 Message-Digest Algorithm
RSA Data Security, Inc. MD5 Message-Digest Algorithm
$Id: copying,v 1.1 2006/02/13 16:08:03 vlad Exp $
+1 -2
View File
@@ -1,6 +1,5 @@
/*
3APA3A simpliest proxy server
(c) 2007-2008 by ZARAZA <3APA3A@security.nnov.ru>
(c) 2007-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+1 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+1 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+3 -3
View File
@@ -1,13 +1,13 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
*/
#define COPYRIGHT "(c)3APA3A, Vladimir Dubrovin & 3proxy.ru\n"\
"Documentation and sources: http://3proxy.ru/\n"\
#define COPYRIGHT "(c)3APA3A, Vladimir Dubrovin & 3proxy.org\n"\
"Documentation and sources: https://3proxy.org/\n"\
"Please read license agreement in \'copying\' file.\n"\
"You may not use this program without accepting license agreement"
+1 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2017 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+1 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+1 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
*/
+1 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2020 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+1 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+3 -3
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
@@ -61,9 +61,9 @@ unsigned char * strings[] = {
"is coded right now. What you see is a part of work that is done\n"
"already.\n"
"<p>Please send all your comments to\n"
"<A HREF=\"mailto:3proxy@security.nnov.ru\">3proxy@security.nnov.ru</A>\n"
"<A HREF=\"mailto:3proxy@3proxy.org\">3proxy@3proxy.org</A>\n"
"<p>Documentation:\n"
"<A HREF=\"http://3proxy.ru/\">http://3proxy.ru/</A>\n"
"<A HREF=\"https://3proxy.org/\">http://3proxy.org/</A>\n"
"</tr></td></table>",
/* 36 */ NULL,
/* 37 */ NULL,
+1 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+1 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+1 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement
+3 -3
View File
@@ -1,12 +1,12 @@
#ifndef VERSION
#define VERSION "3proxy-0.9.3"
#define VERSION "3proxy-0.9.4"
#endif
#ifndef BUILDDATE
#define BUILDDATE ""
#endif
#define MAJOR3PROXY 0
#define SUBMAJOR3PROXY 9
#define MINOR3PROXY 3
#define MINOR3PROXY 4
#define SUBMINOR3PROXY 0
#define RELEASE3PROXY "3proxy-0.9.3(" BUILDDATE ")\0"
#define RELEASE3PROXY "3proxy-0.9.4(" BUILDDATE ")\0"
#define YEAR3PROXY "2021"
+1 -1
View File
@@ -1,6 +1,6 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
please read License Agreement