21 #import "CertificateDialog.h"
22 #import <freerdp/client/cmdline.h>
24 #import <CoreGraphics/CoreGraphics.h>
34 @synthesize textCommonName;
35 @synthesize textFingerprint;
36 @synthesize textIssuer;
37 @synthesize textSubject;
38 @synthesize textMismatch;
39 @synthesize messageLabel;
40 @synthesize serverHostname;
41 @synthesize commonName;
42 @synthesize fingerprint;
45 @synthesize hostMismatch;
51 return [
self initWithWindowNibName:@"CertificateDialog"];
56 [
super windowDidLoad];
59 [
self.window setTitle:self.serverHostname];
61 [
self.messageLabel setStringValue:[NSString stringWithFormat:@"Changed certificate for %@",
62 self.serverHostname]];
64 [
self.messageLabel setStringValue:[NSString stringWithFormat:@"New Certificate for %@",
65 self.serverHostname]];
67 if (!
self.hostMismatch)
69 setStringValue:[NSString stringWithFormat:
70 @"NOTE: The server name matches the certificate, good."]];
73 setStringValue:[NSString
75 @"ATTENTION: The common name does not match the server name!"]];
76 [
self.textCommonName setStringValue:self.commonName];
77 [
self.textFingerprint setStringValue:self.fingerprint];
78 [
self.textIssuer setStringValue:self.issuer];
79 [
self.textSubject setStringValue:self.subject];
82 - (IBAction)onAccept:(NSObject *)sender
84 [NSApp stopModalWithCode:1];
87 - (IBAction)onTemporary:(NSObject *)sender
89 [NSApp stopModalWithCode:2];
92 - (IBAction)onCancel:(NSObject *)sender
94 [NSApp stopModalWithCode:0];
97 - (int)runModal:(NSWindow *)mainWindow
99 if ([mainWindow respondsToSelector:
@selector(beginSheet:completionHandler:)])
101 [mainWindow beginSheet:self.window completionHandler:nil];
102 self.result = [NSApp runModalForWindow:self.window];
103 [mainWindow endSheet:self.window];
107 [NSApp beginSheet:self.window
108 modalForWindow:mainWindow
112 self.result = [NSApp runModalForWindow:self.window];
113 [NSApp endSheet:self.window];
116 [
self.window orderOut:nil];
122 [textCommonName release];
123 [textFingerprint release];
124 [textIssuer release];
125 [textSubject release];
126 [messageLabel release];
127 [serverHostname release];
128 [commonName release];
129 [fingerprint release];