Commit f0d16c4be1748e7ab363fafc15f9ade8692d07d4

Authored by Perry Werneck
Committed by GitHub
2 parents 7ddc463f c8fb0e03
Exists in master and in 1 other branch develop

Merge pull request #31 from PerryWerneck/develop

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