After playing a bit with my new working newpki-client, I noticed that
the « remember my PKCS#12 file » feature was also broken.

That is, once you load you certificate and connect to the PKI, a file
~/.newpki/client_pki is written with the informations you used to login
(server, port, entity, and certificate).

Currently, the same bug happens when writting this file than what
prevented us to open the certificate.

I join a full patch for the debian package's wx2.6 compatibility patch,
that also corrects this behavior. This patch includes the first one.

Have fun.
diff --git a/debian/patches/wx2.6 b/debian/patches/wx2.6
index d9a1477..60d5633 100644
--- a/debian/patches/wx2.6
+++ b/debian/patches/wx2.6
@@ -9060,6 +9060,21 @@ Index: newpki-client-2.0.0+rc1/src/DlgLogin.cpp
  
  	}
  #ifdef _WIN32
+@@ -199,12 +199,12 @@
+ #endif
+ 	else if(((wxRadioButton *)FindWindow(IDC_TYPE_P12_CERT))->GetValue())
+ 	{
+-		filename = ((wxTextCtrl *)FindWindow(IDC_P12_FILE))->GetValue();
++		filename = ((wxTextCtrl *)FindWindow(IDC_P12_FILE))->GetValue().GetData();
+ 		if(!filename.Len()) return;
+ 
+ 		DlgGetPassword dlgpwd(_("Please enter the PKCS#12 password"), this);
+ 		if(!dlgpwd.IsOK()) return;
+-		if(!p12.LoadFromFile((char*)filename.GetData(), dlgpwd.GetPassword().c_str()))
++		if(!p12.LoadFromFile(filename.mb_str(wxConvUTF8), dlgpwd.GetPassword().c_str()))
+ 		{
+ 			HandleErrorResult(NULL, this, 0);
+ 			return;
 @@ -215,9 +215,9 @@
  
  
@@ -9091,6 +9106,23 @@ Index: newpki-client-2.0.0+rc1/src/DlgLogin.cpp
  			OnPKCS12(event);
  			break;
  		default:
+@@ -445,14 +445,14 @@
+ 	FILE * fd = fopen(buffer, "w");
+ 	if(!fd) return;
+ 
+-	currValue = ((wxTextCtrl *)FindWindow(IDC_P12_FILE))->GetValue();
++	currValue = ((wxTextCtrl *)FindWindow(IDC_P12_FILE))->GetValue().GetData();
+ 
+ 	fprintf(fd, "%s=%s\n", ENV_PKI_USER, LogInfos.Username);
+ 	fprintf(fd, "%s=%s\n", ENV_PKI_SERVER, LogInfos.Server);
+ 	fprintf(fd, "%s=%d\n", ENV_PKI_PORT, LogInfos.Port);
+ 	fprintf(fd, "%s=%s\n", ENV_PKI_CA, LogInfos.CaName);
+ 	fprintf(fd, "%s=%s\n", ENV_PKI_TYPE, Type);
+-	fprintf(fd, "%s=%s\n", ENV_PKI_P12FILE, (char*)currValue.GetData());
++	fprintf(fd, "%s=%s\n", ENV_PKI_P12FILE, (const char *)currValue.mb_str(wxConvUTF8));
+ 
+ 	fclose(fd);
+ #endif
 @@ -503,7 +503,7 @@
  
  void DlgLogin::OnBrowsePKC12(wxCommandEvent& event)

Reply via email to