Commit f0d16c4be1748e7ab363fafc15f9ade8692d07d4
Committed by
GitHub
Exists in
master
and in
1 other branch
Merge pull request #31 from PerryWerneck/develop
Fixing win32 SSL certificate error.
Showing
10 changed files
with
169 additions
and
63 deletions
Show diff stats
.vscode/c_cpp_properties.json
... | ... | @@ -16,7 +16,8 @@ |
16 | 16 | "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe", |
17 | 17 | "cStandard": "c11", |
18 | 18 | "cppStandard": "c++17", |
19 | - "intelliSenseMode": "msvc-x64" | |
19 | + "intelliSenseMode": "msvc-x64", | |
20 | + "configurationProvider": "ms-vscode.makefile-tools" | |
20 | 21 | } |
21 | 22 | ], |
22 | 23 | "version": 4 | ... | ... |
configure.ac
... | ... | @@ -389,11 +389,11 @@ dnl SSL Security options |
389 | 389 | dnl --------------------------------------------------------------------------- |
390 | 390 | |
391 | 391 | AC_ARG_ENABLE([self-signed-cert-check], |
392 | - [AS_HELP_STRING([--enable-self-signed-cert-check], [Reject SSL connection when host presents a self signed certificate])], | |
392 | + [AS_HELP_STRING([--enable-self-signed-cert-check], [Emit Warning when host presents a self signed certificate])], | |
393 | 393 | [ |
394 | 394 | app_cv_self_signed_certs="$enableval" |
395 | 395 | ],[ |
396 | - app_cv_self_signed_certs="no" | |
396 | + app_cv_self_signed_certs="yes" | |
397 | 397 | ]) |
398 | 398 | |
399 | 399 | if test "$app_cv_self_signed_certs" == "yes"; then |
... | ... | @@ -518,7 +518,7 @@ AC_ARG_WITH([sdk-version], [AS_HELP_STRING([--with-sdk-version], [Setup library |
518 | 518 | AC_DEFINE(LIB3270_SDK_VERSION,$app_cv_sdkversion,[The SDK version number]) |
519 | 519 | AC_SUBST(LIB3270_SDK_VERSION,$app_cv_sdkversion) |
520 | 520 | |
521 | -AC_ARG_WITH([default-host], [AS_HELP_STRING([--with-default-host], [Set lib3270 default host url])], | |
521 | +AC_ARG_WITH([default-host], [AS_HELP_STRING([--with-default-host], [Set lib3270 default host url])], | |
522 | 522 | [ app_default_host="\"$withval\""], |
523 | 523 | [ app_default_host=""]) |
524 | 524 | |
... | ... | @@ -650,7 +650,7 @@ case "$host" in |
650 | 650 | |
651 | 651 | *-apple-darwin*) |
652 | 652 | AC_PATH_TOOL([CURLCONFIG], [curl-config], [no]) |
653 | - | |
653 | + | |
654 | 654 | if test x$CURLCONFIG = xno; then |
655 | 655 | AC_MSG_NOTICE([Building without CURL support]) |
656 | 656 | AC_SUBST(LIBCURL_CFLAGS) |
... | ... | @@ -662,13 +662,13 @@ case "$host" in |
662 | 662 | AC_SUBST(LIBCURL_LIBS,"$($CURLCONFIG --libs)") |
663 | 663 | fi |
664 | 664 | ;; |
665 | - | |
665 | + | |
666 | 666 | *) |
667 | 667 | PKG_CHECK_MODULES( [LIBCURL], [libcurl], AC_DEFINE(HAVE_LIBCURL,[],[Do we have libcurl?]), AC_MSG_ERROR([libcurl not present.]) ) |
668 | 668 | AC_SUBST(LIBCURL_CFLAGS) |
669 | 669 | AC_SUBST(LIBCURL_LIBS) |
670 | 670 | ;; |
671 | - | |
671 | + | |
672 | 672 | esac |
673 | 673 | |
674 | 674 | dnl --------------------------------------------------------------------------- | ... | ... |
debian/rules
... | ... | @@ -23,14 +23,8 @@ build-stamp: |
23 | 23 | dh_testdir |
24 | 24 | |
25 | 25 | # Add here commands to compile the package. |
26 | - aclocal | |
27 | - autoconf | |
28 | - | |
29 | - mkdir -p scripts | |
30 | - automake --add-missing 2> /dev/null | true | |
31 | - | |
26 | + NOCONFIGURE=1 ./autogen.sh | |
32 | 27 | ./configure --prefix=/usr --disable-static |
33 | - | |
34 | 28 | make all |
35 | 29 | # --- end custom part for compiling |
36 | 30 | ... | ... |
locale/pt_BR.po
... | ... | @@ -5,7 +5,7 @@ msgid "" |
5 | 5 | msgstr "" |
6 | 6 | "Project-Id-Version: pw3270 5.0\n" |
7 | 7 | "Report-Msgid-Bugs-To: \n" |
8 | -"POT-Creation-Date: 2021-09-01 23:49-0300\n" | |
8 | +"POT-Creation-Date: 2021-11-29 14:31-0300\n" | |
9 | 9 | "PO-Revision-Date: 2021-09-01 23:53-0300\n" |
10 | 10 | "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" |
11 | 11 | "Language-Team: Português <perry.werneck@gmail.com>\n" |
... | ... | @@ -277,7 +277,7 @@ msgstr "Erro ao inicializar LDAP" |
277 | 277 | msgid "Can't initialize the TLS/SSL context." |
278 | 278 | msgstr "Erro ao inicializar contexto TLS/SSL" |
279 | 279 | |
280 | -#: src/core/session.c:198 | |
280 | +#: src/core/session.c:205 | |
281 | 281 | msgid "Can't load" |
282 | 282 | msgstr "Não foi possível carregar" |
283 | 283 | |
... | ... | @@ -285,7 +285,7 @@ msgstr "Não foi possível carregar" |
285 | 285 | msgid "Can't open HTTP session" |
286 | 286 | msgstr "Não foi possível abrir sessão HTTP" |
287 | 287 | |
288 | -#: src/core/session.c:186 | |
288 | +#: src/core/session.c:193 | |
289 | 289 | msgid "Can't print" |
290 | 290 | msgstr "Não é possível imprimir" |
291 | 291 | |
... | ... | @@ -293,7 +293,7 @@ msgstr "Não é possível imprimir" |
293 | 293 | msgid "Can't read HTTP response size." |
294 | 294 | msgstr "Não posso obter tamanho da resposta HTTP" |
295 | 295 | |
296 | -#: src/core/session.c:192 | |
296 | +#: src/core/session.c:199 | |
297 | 297 | msgid "Can't save" |
298 | 298 | msgstr "Não é possível salvar" |
299 | 299 | |
... | ... | @@ -512,8 +512,8 @@ msgstr "Tipo de dispositivo rejeitado" |
512 | 512 | msgid "Disconnect from host" |
513 | 513 | msgstr "Desconecta do servidor" |
514 | 514 | |
515 | -#: src/core/ft/ft.c:244 src/network_modules/openssl/main.c:99 | |
516 | -#: src/network_modules/openssl/main.c:147 | |
515 | +#: src/core/ft/ft.c:244 src/network_modules/openssl/main.c:100 | |
516 | +#: src/network_modules/openssl/main.c:148 | |
517 | 517 | msgid "Disconnected from host." |
518 | 518 | msgstr "Desconectado do servidor." |
519 | 519 | |
... | ... | @@ -593,12 +593,12 @@ msgstr "Apagar campos" |
593 | 593 | msgid "Erro sending data to host" |
594 | 594 | msgstr "Erro ao enviar dados para o servidor" |
595 | 595 | |
596 | -#: src/core/ft/ft_dft.c:413 src/core/ft/ft_cut.c:408 | |
596 | +#: src/core/ft/ft_cut.c:408 src/core/ft/ft_dft.c:413 | |
597 | 597 | #, c-format |
598 | 598 | msgid "Error \"%s\" reading from local file (rc=%d)" |
599 | 599 | msgstr "Erro \"%s\" lendo arquivo local (rc=%d)" |
600 | 600 | |
601 | -#: src/core/ft/ft_dft.c:306 src/core/ft/ft_cut.c:504 | |
601 | +#: src/core/ft/ft_cut.c:504 src/core/ft/ft_dft.c:306 | |
602 | 602 | #, c-format |
603 | 603 | msgid "Error \"%s\" writing to local file (rc=%d)" |
604 | 604 | msgstr "Erro \"%s\" gravando arquivo local (rc=%d)" |
... | ... | @@ -611,7 +611,7 @@ msgstr "Erro na transferência do arquivo, transferência cancelada" |
611 | 611 | msgid "Error reading file from host: file transfer canceled" |
612 | 612 | msgstr "Erro ao ler arquivo do host: Transferência cancelada" |
613 | 613 | |
614 | -#: src/network_modules/openssl/main.c:169 | |
614 | +#: src/network_modules/openssl/main.c:170 | |
615 | 615 | msgid "Error reading from host" |
616 | 616 | msgstr "Erro lendo do servidor" |
617 | 617 | |
... | ... | @@ -631,7 +631,7 @@ msgstr "Erro ao ler ou gravar no host: Transferência cancelada" |
631 | 631 | msgid "Error writing file to host: file transfer canceled" |
632 | 632 | msgstr "Erro ao gravar arquivo no host, transferência cancelada" |
633 | 633 | |
634 | -#: src/network_modules/openssl/main.c:122 | |
634 | +#: src/network_modules/openssl/main.c:123 | |
635 | 635 | msgid "Error writing to host." |
636 | 636 | msgstr "Erro enviando para o servidor" |
637 | 637 | |
... | ... | @@ -989,8 +989,8 @@ msgstr "Move para o próximo campo desprotegido" |
989 | 989 | msgid "Move to the previous unprotected field on screen" |
990 | 990 | msgstr "Move para o campo desprotegido anterior" |
991 | 991 | |
992 | -#: src/core/telnet.c:304 src/core/windows/event_dispatcher.c:135 | |
993 | -#: src/core/windows/connect.c:223 | |
992 | +#: src/core/telnet.c:304 src/core/windows/connect.c:223 | |
993 | +#: src/core/windows/event_dispatcher.c:135 | |
994 | 994 | msgid "Network error" |
995 | 995 | msgstr "Erro de rede" |
996 | 996 | |
... | ... | @@ -1500,8 +1500,8 @@ msgstr "" |
1500 | 1500 | "A lista de revogação de certificados (CRL) de um certificado não pôde ser " |
1501 | 1501 | "encontrada." |
1502 | 1502 | |
1503 | -#: src/network_modules/openssl/main.c:123 | |
1504 | -#: src/network_modules/openssl/main.c:170 | |
1503 | +#: src/network_modules/openssl/main.c:124 | |
1504 | +#: src/network_modules/openssl/main.c:171 | |
1505 | 1505 | #, c-format |
1506 | 1506 | msgid "The SSL error message was %s" |
1507 | 1507 | msgstr "A mensagem de erro SSL foi \"%s\"" |
... | ... | @@ -1723,8 +1723,8 @@ msgstr "" |
1723 | 1723 | "O Certificado raiz não está marcado como confiável para os fins " |
1724 | 1724 | "especificados." |
1725 | 1725 | |
1726 | -#: src/network_modules/openssl/main.c:101 | |
1727 | -#: src/network_modules/openssl/main.c:149 | |
1726 | +#: src/network_modules/openssl/main.c:102 | |
1727 | +#: src/network_modules/openssl/main.c:150 | |
1728 | 1728 | msgid "The secure connection has been closed cleanly." |
1729 | 1729 | msgstr "A conexão segura foi fechada corretamente" |
1730 | 1730 | |
... | ... | @@ -1774,7 +1774,7 @@ msgstr "O erro do sistema operacional foi \"%s\" (rc=%d)" |
1774 | 1774 | msgid "The system error was %s" |
1775 | 1775 | msgstr "O erro do sistema operacional foi \"%s\"" |
1776 | 1776 | |
1777 | -#: src/core/util.c:260 | |
1777 | +#: src/core/util.c:264 | |
1778 | 1778 | #, c-format |
1779 | 1779 | msgid "The system error was '%s' (rc=%d)" |
1780 | 1780 | msgstr "O erro do sistema foi \"%s\" (rc=%d)" |
... | ... | @@ -1857,8 +1857,8 @@ msgstr "Mostrar posição do cursor" |
1857 | 1857 | msgid "Transfer cancelled by host" |
1858 | 1858 | msgstr "Transferência cancelada pelo host" |
1859 | 1859 | |
1860 | -#: src/core/ft/ft_dft.c:213 src/core/ft/ft_dft.c:344 src/core/ft/ft_cut.c:387 | |
1861 | -#: src/core/ft/ft_cut.c:475 | |
1860 | +#: src/core/ft/ft_cut.c:387 src/core/ft/ft_cut.c:475 src/core/ft/ft_dft.c:213 | |
1861 | +#: src/core/ft/ft_dft.c:344 | |
1862 | 1862 | msgid "Transfer cancelled by user" |
1863 | 1863 | msgstr "Transferência cancelada pelo usuário" |
1864 | 1864 | |
... | ... | @@ -1915,7 +1915,7 @@ msgstr "Não foi possível obter emissor do certificado" |
1915 | 1915 | msgid "Unable to get local issuer certificate" |
1916 | 1916 | msgstr "Unable to get local issuer certificate" |
1917 | 1917 | |
1918 | -#: src/core/session.c:198 | |
1918 | +#: src/core/session.c:205 | |
1919 | 1919 | msgid "Unable to load from file" |
1920 | 1920 | msgstr "Não foi possível ler do arquivo" |
1921 | 1921 | |
... | ... | @@ -1927,11 +1927,11 @@ msgstr "Incapaz de negociar uma conexão segura com o host" |
1927 | 1927 | msgid "Unable to paste text" |
1928 | 1928 | msgstr "Incapaz de colar texto" |
1929 | 1929 | |
1930 | -#: src/core/session.c:186 | |
1930 | +#: src/core/session.c:193 | |
1931 | 1931 | msgid "Unable to print" |
1932 | 1932 | msgstr "Incapaz de imprimir" |
1933 | 1933 | |
1934 | -#: src/core/session.c:192 | |
1934 | +#: src/core/session.c:199 | |
1935 | 1935 | msgid "Unable to save" |
1936 | 1936 | msgstr "Incapaz de salvar" |
1937 | 1937 | ... | ... |
rpm/_service
... | ... | @@ -10,11 +10,10 @@ |
10 | 10 | </service> |
11 | 11 | |
12 | 12 | <!-- https://github.com/openSUSE/obs-service-extract_file --> |
13 | - | |
14 | - <service name="extract_file"> | |
13 | + <!-- service name="extract_file"> | |
15 | 14 | <param name="archive">*.tar</param> |
16 | 15 | <param name="files">*/rpm/lib3270.spec</param> |
17 | - </service> | |
16 | + </service --> | |
18 | 17 | |
19 | 18 | <service name="extract_file"> |
20 | 19 | <param name="archive">*.tar</param> |
... | ... | @@ -38,11 +37,11 @@ |
38 | 37 | <param name="outfilename">debian.control</param> |
39 | 38 | </service> |
40 | 39 | |
41 | - <service name="extract_file"> | |
40 | + <!-- service name="extract_file"> | |
42 | 41 | <param name="archive">*.tar</param> |
43 | 42 | <param name="files">*/debian/rules</param> |
44 | 43 | <param name="outfilename">debian.rules</param> |
45 | - </service> | |
44 | + </service --> | |
46 | 45 | |
47 | 46 | <service name="extract_file"> |
48 | 47 | <param name="archive">*.tar</param> | ... | ... |
rpm/lib3270.spec
1 | 1 | # |
2 | 2 | # spec file for package lib3270 |
3 | 3 | # |
4 | -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. | |
4 | +# Copyright (c) 2022 SUSE LLC | |
5 | 5 | # Copyright (c) <2008> <Banco do Brasil S.A.> |
6 | 6 | # |
7 | 7 | # All modifications and additions to the file contributed by third parties |
... | ... | @@ -29,15 +29,15 @@ BuildRequires: autoconf >= 2.61 |
29 | 29 | BuildRequires: automake |
30 | 30 | BuildRequires: binutils |
31 | 31 | BuildRequires: coreutils |
32 | -BuildRequires: libtool | |
33 | 32 | BuildRequires: fdupes |
34 | 33 | BuildRequires: gcc-c++ |
35 | 34 | BuildRequires: gettext-devel |
35 | +BuildRequires: libtool | |
36 | 36 | BuildRequires: m4 |
37 | 37 | BuildRequires: pkgconfig |
38 | +BuildRequires: xz | |
38 | 39 | BuildRequires: pkgconfig(libcurl) |
39 | 40 | BuildRequires: pkgconfig(libssl) |
40 | -BuildRequires: xz | |
41 | 41 | |
42 | 42 | %if 0%{?centos_version} |
43 | 43 | # CENTOS Requires gdb for debuginfo |
... | ... | @@ -54,8 +54,8 @@ For more details, see https://softwarepublico.gov.br/social/pw3270/ . |
54 | 54 | %define _libvrs %{MAJOR_VERSION}_%{MINOR_VERSION} |
55 | 55 | |
56 | 56 | %package -n %{name}-%{_libvrs} |
57 | -Summary: TN3270 Access library | |
58 | -Group: Development/Libraries/C and C++ | |
57 | +Summary: TN3270 Access library | |
58 | +Group: Development/Libraries/C and C++ | |
59 | 59 | |
60 | 60 | %description -n %{name}-%{_libvrs} |
61 | 61 | TN3270 access library, originally designed as part of the pw3270 application. |
... | ... | @@ -63,9 +63,9 @@ TN3270 access library, originally designed as part of the pw3270 application. |
63 | 63 | For more details, see https://softwarepublico.gov.br/social/pw3270/ . |
64 | 64 | |
65 | 65 | %package devel |
66 | -Summary: TN3270 Access library development files | |
67 | -Requires: %{name}-%{_libvrs} = %{version} | |
68 | -Group: Development/Libraries/C and C++ | |
66 | +Summary: TN3270 Access library development files | |
67 | +Requires: %{name}-%{_libvrs} = %{version} | |
68 | +Group: Development/Libraries/C and C++ | |
69 | 69 | |
70 | 70 | %description devel |
71 | 71 | Header files for the TN3270 access library. | ... | ... |
src/network_modules/openssl/context.c
... | ... | @@ -193,6 +193,94 @@ SSL_CTX * lib3270_openssl_get_context(H3270 *hSession) { |
193 | 193 | |
194 | 194 | #endif // SSL_ENABLE_CRL_CHECK |
195 | 195 | |
196 | +#ifdef _WIN32 | |
197 | + { | |
198 | + // Load certs | |
199 | + // https://stackoverflow.com/questions/9507184/can-openssl-on-windows-use-the-system-certificate-store | |
200 | + X509_STORE * store = SSL_CTX_get_cert_store(context); | |
201 | + | |
202 | + lib3270_autoptr(char) certpath = lib3270_build_data_filename("certs","*.der",NULL); | |
203 | + | |
204 | + trace_ssl(hSession,"Loading SSL certs from %s\n",certpath); | |
205 | + | |
206 | + WIN32_FIND_DATA ffd; | |
207 | + HANDLE hFind = FindFirstFile(certpath, &ffd); | |
208 | + | |
209 | + if(hFind == INVALID_HANDLE_VALUE) | |
210 | + { | |
211 | + static const LIB3270_SSL_MESSAGE message = { | |
212 | + .type = LIB3270_NOTIFY_SECURE, | |
213 | + .icon = "dialog-error", | |
214 | + .summary = N_( "Cant open custom certificate directory." ), | |
215 | + }; | |
216 | + | |
217 | + hSession->ssl.message = &message; | |
218 | + | |
219 | + trace_ssl(hSession, _( "Can't open \"%s\" (The Windows error code was %ld)" ), certpath, (long) GetLastError()); | |
220 | + } | |
221 | + else | |
222 | + { | |
223 | + do | |
224 | + { | |
225 | + char * filename = lib3270_build_data_filename("certs", ffd.cFileName, NULL); | |
226 | + | |
227 | + debug("Loading \"%s\"",filename); | |
228 | + | |
229 | + FILE *fp = fopen(filename,"r"); | |
230 | + if(!fp) { | |
231 | + | |
232 | + trace_ssl(hSession, _( "Can't open \"%s\": %s" ), filename, strerror(errno)); | |
233 | + | |
234 | + } | |
235 | + else | |
236 | + { | |
237 | + X509 * cert = d2i_X509_fp(fp, NULL); | |
238 | + | |
239 | + if(!cert) | |
240 | + { | |
241 | + static const LIB3270_SSL_MESSAGE message = { | |
242 | + .type = LIB3270_NOTIFY_SECURE, | |
243 | + .icon = "dialog-error", | |
244 | + .summary = N_( "Cant read custom certificate file." ), | |
245 | + }; | |
246 | + | |
247 | + hSession->ssl.message = &message; | |
248 | + hSession->network.context->state.error = ERR_get_error(); | |
249 | + | |
250 | + trace_ssl(hSession, _( "Can't read \"%s\": %s" ), filename, ERR_lib_error_string(hSession->ssl.error)); | |
251 | + } | |
252 | + else | |
253 | + { | |
254 | + | |
255 | + if(X509_STORE_add_cert(store, cert) != 1) | |
256 | + { | |
257 | + static const LIB3270_SSL_MESSAGE message = { | |
258 | + .type = LIB3270_NOTIFY_SECURE, | |
259 | + .icon = "dialog-error", | |
260 | + .summary = N_( "Cant load custom certificate file." ), | |
261 | + }; | |
262 | + | |
263 | + hSession->ssl.message = &message; | |
264 | + hSession->network.context->state.error = ERR_get_error(); | |
265 | + | |
266 | + trace_ssl(hSession, _( "Can't load \"%s\": %s" ), filename, ERR_lib_error_string(hSession->ssl.error)); | |
267 | + } | |
268 | + | |
269 | + X509_free(cert); | |
270 | + } | |
271 | + | |
272 | + fclose(fp); | |
273 | + } | |
274 | + | |
275 | + lib3270_free(filename); | |
276 | + | |
277 | + } | |
278 | + while (FindNextFile(hFind, &ffd) != 0); | |
279 | + | |
280 | + } | |
281 | + } | |
282 | +#endif // _WIN32 | |
283 | + | |
196 | 284 | return context; |
197 | 285 | |
198 | 286 | } | ... | ... |
src/network_modules/openssl/messages.c
... | ... | @@ -46,6 +46,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
46 | 46 | { |
47 | 47 | .id = X509_V_OK, |
48 | 48 | .message = { |
49 | + .name = "X509_V_OK", | |
49 | 50 | .type = LIB3270_NOTIFY_INFO, |
50 | 51 | .icon = "security-high", |
51 | 52 | .summary = N_( "Secure connection was successful." ), |
... | ... | @@ -56,6 +57,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
56 | 57 | { |
57 | 58 | .id = X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT, |
58 | 59 | .message = { |
60 | + .name = "X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT", | |
59 | 61 | .type = LIB3270_NOTIFY_SECURE, |
60 | 62 | .icon = "dialog-error", |
61 | 63 | .summary = N_( "Unable to get issuer certificate" ), |
... | ... | @@ -66,12 +68,12 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
66 | 68 | { |
67 | 69 | .id = X509_V_ERR_UNABLE_TO_GET_CRL, |
68 | 70 | .message = { |
71 | + .name = "X509_V_ERR_UNABLE_TO_GET_CRL", | |
69 | 72 | #ifdef SSL_ENABLE_CRL_CHECK |
70 | 73 | .type = LIB3270_NOTIFY_SECURE, |
71 | 74 | #else |
72 | 75 | .type = LIB3270_NOTIFY_INFO, |
73 | 76 | #endif // SSL_ENABLE_CRL_CHECK |
74 | - .name = "X509UnableToGetCRL", | |
75 | 77 | .icon = "security-low", |
76 | 78 | .summary = N_( "Unable to get certificate CRL." ), |
77 | 79 | .body = N_( "The Certificate revocation list (CRL) of a certificate could not be found." ), |
... | ... | @@ -82,6 +84,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
82 | 84 | { |
83 | 85 | .id = X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE, |
84 | 86 | .message = { |
87 | + .name = "X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE", | |
85 | 88 | .type = LIB3270_NOTIFY_SECURE, |
86 | 89 | .icon = "dialog-error", |
87 | 90 | .summary = N_( "Unable to decrypt certificate's signature" ), |
... | ... | @@ -92,6 +95,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
92 | 95 | { |
93 | 96 | .id = X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE, |
94 | 97 | .message = { |
98 | + .name = "X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE", | |
95 | 99 | .type = LIB3270_NOTIFY_SECURE, |
96 | 100 | .icon = "dialog-error", |
97 | 101 | .summary = N_( "Unable to decrypt CRL's signature" ), |
... | ... | @@ -102,6 +106,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
102 | 106 | { |
103 | 107 | .id = X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY, |
104 | 108 | .message = { |
109 | + .name = "X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY", | |
105 | 110 | .type = LIB3270_NOTIFY_SECURE, |
106 | 111 | .icon = "dialog-error", |
107 | 112 | .summary = N_( "Unable to decode issuer public key" ), |
... | ... | @@ -112,6 +117,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
112 | 117 | { |
113 | 118 | .id = X509_V_ERR_CERT_SIGNATURE_FAILURE, |
114 | 119 | .message = { |
120 | + .name = "X509_V_ERR_CERT_SIGNATURE_FAILURE", | |
115 | 121 | .type = LIB3270_NOTIFY_SECURE, |
116 | 122 | .icon = "dialog-error", |
117 | 123 | .summary = N_( "Certificate signature failure" ), |
... | ... | @@ -122,6 +128,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
122 | 128 | { |
123 | 129 | .id = X509_V_ERR_CRL_SIGNATURE_FAILURE, |
124 | 130 | .message = { |
131 | + .name = "X509_V_ERR_CRL_SIGNATURE_FAILURE", | |
125 | 132 | .type = LIB3270_NOTIFY_SECURE, |
126 | 133 | .icon = "dialog-error", |
127 | 134 | .summary = N_( "CRL signature failure" ), |
... | ... | @@ -132,6 +139,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
132 | 139 | { |
133 | 140 | .id = X509_V_ERR_CERT_NOT_YET_VALID, |
134 | 141 | .message = { |
142 | + .name = "X509_V_ERR_CERT_NOT_YET_VALID", | |
135 | 143 | .type = LIB3270_NOTIFY_WARNING, |
136 | 144 | .icon = "security-medium", |
137 | 145 | .summary = N_( "Certificate is not yet valid" ), |
... | ... | @@ -142,6 +150,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
142 | 150 | { |
143 | 151 | .id = X509_V_ERR_CERT_HAS_EXPIRED, |
144 | 152 | .message = { |
153 | + .name = "X509_V_ERR_CERT_HAS_EXPIRED", | |
145 | 154 | .type = LIB3270_NOTIFY_SECURE, |
146 | 155 | .icon = "security-medium", |
147 | 156 | .summary = N_( "Certificate has expired" ), |
... | ... | @@ -152,6 +161,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
152 | 161 | { |
153 | 162 | .id = X509_V_ERR_CRL_NOT_YET_VALID, |
154 | 163 | .message = { |
164 | + .name = "X509_V_ERR_CRL_NOT_YET_VALID", | |
155 | 165 | .type = LIB3270_NOTIFY_WARNING, |
156 | 166 | .icon = "security-medium", |
157 | 167 | .summary = N_( "The CRL is not yet valid." ), |
... | ... | @@ -162,6 +172,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
162 | 172 | { |
163 | 173 | .id = X509_V_ERR_CRL_HAS_EXPIRED, |
164 | 174 | .message = { |
175 | + .name = "X509_V_ERR_CRL_HAS_EXPIRED", | |
165 | 176 | #ifdef SSL_ENABLE_CRL_EXPIRATION_CHECK |
166 | 177 | .type = LIB3270_NOTIFY_SECURE, |
167 | 178 | #else |
... | ... | @@ -176,6 +187,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
176 | 187 | { |
177 | 188 | .id = X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD, |
178 | 189 | .message = { |
190 | + .name = "X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD", | |
179 | 191 | .type = LIB3270_NOTIFY_SECURE, |
180 | 192 | .icon = "dialog-error", |
181 | 193 | .summary = N_( "Format error in certificate's notBefore field" ), |
... | ... | @@ -186,6 +198,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
186 | 198 | { |
187 | 199 | .id = X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD, |
188 | 200 | .message = { |
201 | + .name = "X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD", | |
189 | 202 | .type = LIB3270_NOTIFY_SECURE, |
190 | 203 | .icon = "dialog-error", |
191 | 204 | .summary = N_( "Format error in certificate's notAfter field" ), |
... | ... | @@ -196,6 +209,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
196 | 209 | { |
197 | 210 | .id = X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD, |
198 | 211 | .message = { |
212 | + .name = "X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD", | |
199 | 213 | .type = LIB3270_NOTIFY_SECURE, |
200 | 214 | .icon = "dialog-error", |
201 | 215 | .summary = N_( "Format error in CRL's lastUpdate field" ), |
... | ... | @@ -206,6 +220,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
206 | 220 | { |
207 | 221 | .id = X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD, |
208 | 222 | .message = { |
223 | + .name = "X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD", | |
209 | 224 | .type = LIB3270_NOTIFY_SECURE, |
210 | 225 | .icon = "dialog-error", |
211 | 226 | .summary = N_( "Format error in CRL's nextUpdate field" ), |
... | ... | @@ -216,6 +231,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
216 | 231 | { |
217 | 232 | .id = X509_V_ERR_OUT_OF_MEM, |
218 | 233 | .message = { |
234 | + .name = "X509_V_ERR_OUT_OF_MEM", | |
219 | 235 | .type = LIB3270_NOTIFY_ERROR, |
220 | 236 | .icon = "dialog-error", |
221 | 237 | .summary = N_( "Out of memory" ), |
... | ... | @@ -226,14 +242,14 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
226 | 242 | { |
227 | 243 | .id = X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT, |
228 | 244 | .message = { |
245 | + .name = "X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT", | |
229 | 246 | #ifdef SSL_ENABLE_SELF_SIGNED_CERT_CHECK |
230 | - .type = LIB3270_NOTIFY_SECURE, | |
231 | -#else | |
232 | 247 | .type = LIB3270_NOTIFY_WARNING, |
248 | +#else | |
249 | + .type = LIB3270_NOTIFY_SECURE, | |
233 | 250 | #endif // SSL_ENABLE_SELF_SIGNED_CERT_CHECK |
234 | 251 | .icon = "security-medium", |
235 | 252 | .summary = N_( "Self signed certificate" ), |
236 | - .name = "X509DepthZeroSelfSignedCert", | |
237 | 253 | .label = N_( "Continue" ), |
238 | 254 | .body = N_( "The passed certificate is self signed and the same certificate cannot be found in the list of trusted certificates." ) |
239 | 255 | } |
... | ... | @@ -242,12 +258,12 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
242 | 258 | { |
243 | 259 | .id = X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN, |
244 | 260 | .message = { |
261 | + .name = "X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN", | |
245 | 262 | #ifdef SSL_ENABLE_SELF_SIGNED_CERT_CHECK |
246 | - .type = LIB3270_NOTIFY_SECURE, | |
247 | -#else | |
248 | 263 | .type = LIB3270_NOTIFY_INFO, |
264 | +#else | |
265 | + .type = LIB3270_NOTIFY_SECURE, | |
249 | 266 | #endif // SSL_ENABLE_SELF_SIGNED_CERT_CHECK |
250 | - .name = "SelfSignedCertInChain", | |
251 | 267 | .icon = "security-low", |
252 | 268 | .label = N_("Continue"), |
253 | 269 | .summary = N_( "Self signed certificate in certificate chain" ), |
... | ... | @@ -258,6 +274,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
258 | 274 | { |
259 | 275 | .id = X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY, |
260 | 276 | .message = { |
277 | + .name = "X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY", | |
261 | 278 | .type = LIB3270_NOTIFY_WARNING, |
262 | 279 | .icon = "security-low", |
263 | 280 | .summary = N_( "Unable to get local issuer certificate" ), |
... | ... | @@ -268,6 +285,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
268 | 285 | { |
269 | 286 | .id = X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE, |
270 | 287 | .message = { |
288 | + .name = "X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE", | |
271 | 289 | .type = LIB3270_NOTIFY_SECURE, |
272 | 290 | .icon = "security-low", |
273 | 291 | .summary = N_( "Unable to verify the first certificate" ), |
... | ... | @@ -278,6 +296,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
278 | 296 | { |
279 | 297 | .id = X509_V_ERR_CERT_REVOKED, |
280 | 298 | .message = { |
299 | + .name = "X509_V_ERR_CERT_REVOKED", | |
281 | 300 | .type = LIB3270_NOTIFY_SECURE, |
282 | 301 | .icon = "security-low", |
283 | 302 | .summary = N_( "Certificate revoked" ), |
... | ... | @@ -288,6 +307,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
288 | 307 | { |
289 | 308 | .id = X509_V_ERR_INVALID_CA, |
290 | 309 | .message = { |
310 | + .name = "X509_V_ERR_INVALID_CA", | |
291 | 311 | .type = LIB3270_NOTIFY_SECURE, |
292 | 312 | .icon = "security-low", |
293 | 313 | .summary = N_( "Invalid CA certificate" ), |
... | ... | @@ -298,6 +318,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
298 | 318 | { |
299 | 319 | .id = X509_V_ERR_PATH_LENGTH_EXCEEDED, |
300 | 320 | .message = { |
321 | + .name = "X509_V_ERR_PATH_LENGTH_EXCEEDED", | |
301 | 322 | .type = LIB3270_NOTIFY_SECURE, |
302 | 323 | .icon = "dialog-error", |
303 | 324 | .summary = N_( "Path length constraint exceeded" ), |
... | ... | @@ -308,6 +329,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
308 | 329 | { |
309 | 330 | .id = X509_V_ERR_INVALID_PURPOSE, |
310 | 331 | .message = { |
332 | + .name = "X509_V_ERR_INVALID_PURPOSE", | |
311 | 333 | .type = LIB3270_NOTIFY_SECURE, |
312 | 334 | .icon = "dialog-error", |
313 | 335 | .summary = N_( "Unsupported certificate purpose" ), |
... | ... | @@ -318,6 +340,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
318 | 340 | { |
319 | 341 | .id = X509_V_ERR_CERT_UNTRUSTED, |
320 | 342 | .message = { |
343 | + .name = "X509_V_ERR_CERT_UNTRUSTED", | |
321 | 344 | .type = LIB3270_NOTIFY_WARNING, |
322 | 345 | .icon = "security-low", |
323 | 346 | .summary = N_( "Certificate not trusted" ), |
... | ... | @@ -328,6 +351,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
328 | 351 | { |
329 | 352 | .id = X509_V_ERR_CERT_REJECTED, |
330 | 353 | .message = { |
354 | + .name = "X509_V_ERR_CERT_REJECTED", | |
331 | 355 | .type = LIB3270_NOTIFY_SECURE, |
332 | 356 | .icon = "security-low", |
333 | 357 | .summary = N_( "Certificate rejected" ), |
... | ... | @@ -338,6 +362,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
338 | 362 | { |
339 | 363 | .id = X509_V_ERR_SUBJECT_ISSUER_MISMATCH, |
340 | 364 | .message = { |
365 | + .name = "X509_V_ERR_SUBJECT_ISSUER_MISMATCH", | |
341 | 366 | .type = LIB3270_NOTIFY_SECURE, |
342 | 367 | .icon = "security-low", |
343 | 368 | .summary = N_( "Subject issuer mismatch" ), |
... | ... | @@ -348,6 +373,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
348 | 373 | { |
349 | 374 | .id = X509_V_ERR_AKID_SKID_MISMATCH, |
350 | 375 | .message = { |
376 | + .name = "X509_V_ERR_AKID_SKID_MISMATCH", | |
351 | 377 | .type = LIB3270_NOTIFY_SECURE, |
352 | 378 | .icon = "dialog-error", |
353 | 379 | .summary = N_( "Authority and subject key identifier mismatch" ), |
... | ... | @@ -358,6 +384,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
358 | 384 | { |
359 | 385 | .id = X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH, |
360 | 386 | .message = { |
387 | + .name = "X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH", | |
361 | 388 | .type = LIB3270_NOTIFY_SECURE, |
362 | 389 | .icon = "dialog-error", |
363 | 390 | .summary = N_( "Authority and issuer serial number mismatch" ), |
... | ... | @@ -368,6 +395,7 @@ const LIB3270_SSL_MESSAGE * lib3270_openssl_message_from_id(long id) { |
368 | 395 | { |
369 | 396 | .id = X509_V_ERR_KEYUSAGE_NO_CERTSIGN, |
370 | 397 | .message = { |
398 | + .name = "X509_V_ERR_KEYUSAGE_NO_CERTSIGN", | |
371 | 399 | .type = LIB3270_NOTIFY_SECURE, |
372 | 400 | .icon = "dialog-error", |
373 | 401 | .summary = N_( "Key usage does not include certificate signing" ), | ... | ... |
src/network_modules/state.c
... | ... | @@ -88,12 +88,8 @@ LIB3270_EXPORT const char * lib3270_get_ssl_state_icon_name(const H3270 *hSessio |
88 | 88 | |
89 | 89 | LIB3270_EXPORT const char * lib3270_get_ssl_state_description(const H3270 *hSession) { |
90 | 90 | |
91 | - if(hSession->ssl.message) { | |
92 | - | |
93 | - if(hSession->ssl.message->body) | |
94 | - return dgettext(GETTEXT_PACKAGE,hSession->ssl.message->body); | |
95 | - | |
96 | - return ""; | |
91 | + if(hSession->ssl.message && hSession->ssl.message->body) { | |
92 | + return dgettext(GETTEXT_PACKAGE,hSession->ssl.message->body); | |
97 | 93 | } |
98 | 94 | |
99 | 95 | return ""; | ... | ... |
src/testprogram/testprogram.c