リビジョン | b6515d18bc6bb6e3ef1e853f1ff5535300cec295 (tree) |
---|---|
日時 | 2021-11-20 21:02:30 |
作者 | dyknon <dyknon@user...> |
コミッター | dyknon |
debug version
@@ -1,3 +1,9 @@ | ||
1 | +sslsniff (0.8-9+~dyknon1.1) UNRELEASED; urgency=medium | |
2 | + | |
3 | + * debug version | |
4 | + | |
5 | + -- dyknon <dyknon@users.osdn.me> Sat, 20 Nov 2021 20:51:23 +0900 | |
6 | + | |
1 | 7 | sslsniff (0.8-9+~dyknon1) unstable; urgency=medium |
2 | 8 | |
3 | 9 | * fix bugs. |
@@ -0,0 +1,57 @@ | ||
1 | +From: dyknon <dyknon@users.osdn.me> | |
2 | +Date: Sat, 20 Nov 2021 20:49:46 +0900 | |
3 | +Subject: 4debug | |
4 | + | |
5 | +--- | |
6 | + certificate/AuthorityCertificateManager.cpp | 31 +++++++++++++++++++++++++++++ | |
7 | + 1 file changed, 31 insertions(+) | |
8 | + | |
9 | +diff --git a/certificate/AuthorityCertificateManager.cpp b/certificate/AuthorityCertificateManager.cpp | |
10 | +index bcd550a..d7f83c6 100644 | |
11 | +--- a/certificate/AuthorityCertificateManager.cpp | |
12 | ++++ b/certificate/AuthorityCertificateManager.cpp | |
13 | +@@ -19,6 +19,8 @@ | |
14 | + | |
15 | + #include "AuthorityCertificateManager.hpp" | |
16 | + | |
17 | ++#include <stdlib.h> | |
18 | ++#include <stdio.h> | |
19 | + | |
20 | + AuthorityCertificateManager::AuthorityCertificateManager(std::string &file, std::string &chain) { | |
21 | + path certPath(file); | |
22 | +@@ -74,6 +76,35 @@ void AuthorityCertificateManager::getCertificateForTarget(boost::asio::ip::tcp:: | |
23 | + | |
24 | + X509_sign(request, authority->getKey(), EVP_sha256()); | |
25 | + | |
26 | ++ char buf[80]; | |
27 | ++ std::string tmp_tmp("dyncert_"); | |
28 | ++ if(!X509_NAME_oneline(serverName, buf, sizeof(buf))){ | |
29 | ++ throw "TODO"; | |
30 | ++ } | |
31 | ++ std::string cert_id(buf); | |
32 | ++ std::replace_if(cert_id.begin(), cert_id.end(), | |
33 | ++ [](char c){ | |
34 | ++ return !('0' <= c && c <= '9' | |
35 | ++ || 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' | |
36 | ++ || c == '.' || c == '-'); | |
37 | ++ }, | |
38 | ++ '_'); | |
39 | ++ tmp_tmp += cert_id; | |
40 | ++ tmp_tmp += "_XXXXXX"; | |
41 | ++ int cert_fd = mkstemp(tmp_tmp.data()); | |
42 | ++ if(cert_fd < 0){ | |
43 | ++ throw "TODO"; | |
44 | ++ } | |
45 | ++ FILE *cert_f = fdopen(cert_fd, "w"); | |
46 | ++ if(!cert_f){ | |
47 | ++ throw "TODO"; | |
48 | ++ } | |
49 | ++ if(!PEM_write_X509(cert_f, request)){ | |
50 | ++ unsigned long err = ERR_get_error(); | |
51 | ++ throw "TODO"; | |
52 | ++ } | |
53 | ++ fclose(cert_f); | |
54 | ++ | |
55 | + Certificate *leaf = new Certificate(); | |
56 | + leaf->setCert(request); | |
57 | + leaf->setKey(this->leafPair); |
@@ -6,3 +6,4 @@ boost-1.67.patch | ||
6 | 6 | Fix-FTBFS-with-Boost-1.71.patch |
7 | 7 | fix_FTBFS_boost174.patch |
8 | 8 | all-fixs.patch |
9 | +4debug.patch |