diff --git a/client/Mac/CMakeLists.txt b/client/Mac/CMakeLists.txt
index 94d7775f4..b3eb59187 100644
--- a/client/Mac/CMakeLists.txt
+++ b/client/Mac/CMakeLists.txt
@@ -30,7 +30,9 @@ set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${FREERDP_VERSION})
set(MACOSX_BUNDLE_BUNDLE_VERSION ${FREERDP_VERSION})
set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2013-${VERSION_YEAR}. All Rights Reserved.")
-set(${MODULE_PREFIX}_XIBS PasswordDialog.xib)
+set(${MODULE_PREFIX}_XIBS
+ CertificateDialog.xib
+ PasswordDialog.xib)
set(${MODULE_PREFIX}_SOURCES "")
diff --git a/client/Mac/CertificateDialog.h b/client/Mac/CertificateDialog.h
index d89cf253b..2fccbcbfd 100644
--- a/client/Mac/CertificateDialog.h
+++ b/client/Mac/CertificateDialog.h
@@ -27,16 +27,19 @@
NSTextField* textSubject;
NSTextField* textIssuer;
NSTextField* textFingerprint;
+ NSTextField* textMismatch;
NSTextField* messageLabel;
NSString* serverHostname;
BOOL hostMismatch;
+ BOOL changed;
int result;
}
@property(retain) IBOutlet NSTextField* textCommonName;
@property(retain) IBOutlet NSTextField* textSubject;
@property(retain) IBOutlet NSTextField* textIssuer;
@property(retain) IBOutlet NSTextField* textFingerprint;
+@property(retain) IBOutlet NSTextField* textMismatch;
@property(retain) IBOutlet NSTextField* messageLabel;
- (IBAction)onAccept:(NSObject*)sender;
@@ -49,6 +52,7 @@
@property(retain) NSString* issuer;
@property(retain) NSString* fingerprint;
@property BOOL hostMismatch;
+@property BOOL changed;
@property(readonly) int result;
- (int) runModal:(NSWindow*)mainWindow;
diff --git a/client/Mac/CertificateDialog.m b/client/Mac/CertificateDialog.m
index 24954059f..450b90f65 100644
--- a/client/Mac/CertificateDialog.m
+++ b/client/Mac/CertificateDialog.m
@@ -42,6 +42,8 @@
@synthesize issuer;
@synthesize subject;
@synthesize hostMismatch;
+@synthesize changed;
+@synthesize result;
- (id)init
{
@@ -53,9 +55,17 @@
[super windowDidLoad];
// Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
[self.window setTitle:self.serverHostname];
- [self.messageLabel setStringValue:[NSString stringWithFormat:@"Certificate for %@",
+ if (self.changed)
+ [self.messageLabel setStringValue:[NSString stringWithFormat:@"Changed certificate for %@",
self.serverHostname]];
+ else
+ [self.messageLabel setStringValue:[NSString stringWithFormat:@"New Certificate for %@",
+ self.serverHostname]];
+ if (!self.hostMismatch)
+ [self.textMismatch setStringValue:[NSString stringWithFormat:@"NOTE: The server name matches the certificate, good."]];
+ else
+ [self.textMismatch setStringValue:[NSString stringWithFormat:@"ATTENTION: The common name does not match the server name!"]];
[self.textCommonName setStringValue:self.commonName];
[self.textFingerprint setStringValue:self.fingerprint];
[self.textIssuer setStringValue:self.issuer];
diff --git a/client/Mac/CertificateDialog.xib b/client/Mac/CertificateDialog.xib
index 27f215d0f..b9da883be 100644
--- a/client/Mac/CertificateDialog.xib
+++ b/client/Mac/CertificateDialog.xib
@@ -8,11 +8,12 @@
-
-
-
+
+
+
+
@@ -26,38 +27,12 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -77,7 +52,7 @@ Gw
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
diff --git a/client/Mac/MRDPView.m b/client/Mac/MRDPView.m
index 52b333b2e..24e8c7924 100644
--- a/client/Mac/MRDPView.m
+++ b/client/Mac/MRDPView.m
@@ -1030,27 +1030,45 @@ DWORD mac_verify_certificate(freerdp* instance, const char* common_name, const c
mfContext* mfc = (mfContext*) instance->context;
MRDPView* view = (MRDPView*) mfc->view;
CertificateDialog* dialog = [CertificateDialog new];
- dialog.serverHostname = [NSString stringWithCString:subject encoding:
- NSUTF8StringEncoding];;
+ dialog.serverHostname = [NSString stringWithFormat:@"TODO: The server name we connect to."];
dialog.commonName = [NSString stringWithCString:common_name encoding:
- NSUTF8StringEncoding];;
+ NSUTF8StringEncoding];
dialog.subject = [NSString stringWithCString:subject encoding:
- NSUTF8StringEncoding];;
+ NSUTF8StringEncoding];
dialog.issuer = [NSString stringWithCString:issuer encoding:
- NSUTF8StringEncoding];;
+ NSUTF8StringEncoding];
dialog.fingerprint = [NSString stringWithCString:fingerprint encoding:
- NSUTF8StringEncoding];;
+ NSUTF8StringEncoding];
dialog.hostMismatch = host_mismatch;
+ dialog.changed = FALSE;
[dialog performSelectorOnMainThread:@selector(runModal:) withObject:[view
window] waitUntilDone:TRUE];
return dialog.result;
}
-DWORD mac_verify_changed_certificate(freerdp* instance, const char* common_name, const char* subject, const char* issuer, const char* fingerprint, const char* old_subject, const char* old_issuer, const char* old_fingerprint)
+DWORD mac_verify_changed_certificate(freerdp* instance, const char* common_name,
+ const char* subject, const char* issuer, const char* fingerprint,
+ const char* old_subject, const char* old_issuer, const char* old_fingerprint)
{
- WLog_WARN(TAG, "TODO: Implement %s, accepting everything", __FUNCTION__);
- return 2;
+ mfContext* mfc = (mfContext*) instance->context;
+ MRDPView* view = (MRDPView*) mfc->view;
+ CertificateDialog* dialog = [CertificateDialog new];
+ dialog.serverHostname = [NSString stringWithFormat:@"TODO: The server name we connect to."];
+ dialog.commonName = [NSString stringWithCString:common_name encoding:
+ NSUTF8StringEncoding];
+ dialog.subject = [NSString stringWithCString:subject encoding:
+ NSUTF8StringEncoding];
+ dialog.issuer = [NSString stringWithCString:issuer encoding:
+ NSUTF8StringEncoding];
+ dialog.fingerprint = [NSString stringWithCString:fingerprint encoding:
+ NSUTF8StringEncoding];
+ dialog.hostMismatch = FALSE;
+ dialog.changed = TRUE;
+ [dialog performSelectorOnMainThread:@selector(runModal:) withObject:[view
+ window] waitUntilDone:TRUE];
+
+ return dialog.result;
}
int mac_logon_error_info(freerdp* instance, UINT32 data, UINT32 type)
diff --git a/client/Mac/cli/MainMenu.xib b/client/Mac/cli/MainMenu.xib
index 65e72b118..f647699f4 100644
--- a/client/Mac/cli/MainMenu.xib
+++ b/client/Mac/cli/MainMenu.xib
@@ -1,631 +1,120 @@
-
-
- 1070
- 12E55
- 3084
- 1187.39
- 626.00
-
-
- NSCustomObject
- NSMenu
- NSMenuItem
- NSView
- NSWindowTemplate
-
-
- com.apple.InterfaceBuilder.CocoaPlugin
-
-
-
-
-
-
-
-
-
- AppDelegate
-
-
- NSFontManager
-
-
-
-
-
-
- terminate:
-
-
-
- 449
-
-
-
- orderFrontStandardAboutPanel:
-
-
-
- 142
-
-
-
- delegate
-
-
-
- 568
-
-
-
- performMiniaturize:
-
-
-
- 37
-
-
-
- arrangeInFront:
-
-
-
- 39
-
-
-
- performZoom:
-
-
-
- 240
-
-
-
- hide:
-
-
-
- 367
-
-
-
- hideOtherApplications:
-
-
-
- 368
-
-
-
- unhideAllApplications:
-
-
-
- 370
-
-
-
- showHelp:
-
-
-
- 493
-
-
-
- window
-
-
-
- 570
-
-
-
-
-
- 0
-
-
-
-
-
- -2
-
-
- File's Owner
-
-
- -1
-
-
- First Responder
-
-
- -3
-
-
- Application
-
-
- 29
-
-
-
-
-
-
-
-
-
-
-
-
-
- 19
-
-
-
-
-
-
-
- 56
-
-
-
-
-
-
-
- 217
-
-
-
-
-
- 83
-
-
-
-
-
- 57
-
-
-
-
-
-
-
-
-
-
-
-
-
- 58
-
-
-
-
- 134
-
-
-
-
- 150
-
-
-
-
- 136
-
-
-
-
- 236
-
-
-
-
- 149
-
-
-
-
- 145
-
-
-
-
- 24
-
-
-
-
-
-
-
-
-
-
- 92
-
-
-
-
- 5
-
-
-
-
- 239
-
-
-
-
- 23
-
-
-
-
- 295
-
-
-
-
-
- 371
-
-
-
-
-
-
-
- 372
-
-
-
-
-
- 375
-
-
-
-
-
- 420
-
-
-
-
- 490
-
-
-
-
-
-
-
- 491
-
-
-
-
-
-
-
- 492
-
-
-
-
- 494
-
-
-
-
-
-
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
-
-
- com.apple.InterfaceBuilder.CocoaPlugin
- {{380, 496}, {480, 360}}
-
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
-
-
-
-
-
- 570
-
-
- 0
- IBCocoaFramework
-
- com.apple.InterfaceBuilder.CocoaPlugin.macosx
-
-
- YES
- 3
-
- {11, 11}
- {10, 3}
-
- YES
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+