Skip to content

Commit

Permalink
Fixed glitches with certificate dialog.
Browse files Browse the repository at this point in the history
  • Loading branch information
akallabeth committed Dec 6, 2018
1 parent ec34657 commit 730b6f0
Show file tree
Hide file tree
Showing 6 changed files with 230 additions and 696 deletions.
4 changes: 3 additions & 1 deletion client/Mac/CMakeLists.txt
Expand Up @@ -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 "")

Expand Down
4 changes: 4 additions & 0 deletions client/Mac/CertificateDialog.h
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
12 changes: 11 additions & 1 deletion client/Mac/CertificateDialog.m
Expand Up @@ -42,6 +42,8 @@ @implementation CertificateDialog
@synthesize issuer;
@synthesize subject;
@synthesize hostMismatch;
@synthesize changed;
@synthesize result;

- (id)init
{
Expand All @@ -53,9 +55,17 @@ - (void)windowDidLoad
[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];
Expand Down
121 changes: 66 additions & 55 deletions client/Mac/CertificateDialog.xib
Expand Up @@ -8,11 +8,12 @@
<customObject id="-2" userLabel="File's Owner" customClass="CertificateDialog">
<connections>
<outlet property="messageLabel" destination="7" id="50"/>
<outlet property="window" destination="1" id="3"/>
<outlet property="textCommonName" destination="2HW-of-a4n" id="4442"/>
<outlet property="textSubject" destination="R9r-82-XAH" id="4443"/>
<outlet property="textIssuer" destination="kHA-F4-dxw" id="4444"/>
<outlet property="textFingerprint" destination="cLB-ZO-jvx" id="4445"/>
<outlet property="textIssuer" destination="kHA-F4-dxw" id="4444"/>
<outlet property="textMismatch" destination="LgQ-ni-jXv" id="5550"/>
<outlet property="textSubject" destination="R9r-82-XAH" id="4443"/>
<outlet property="window" destination="1" id="3"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
Expand All @@ -26,38 +27,12 @@
<rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5">
<rect key="frame" x="47" y="134" width="51" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Subject" id="22">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="vA4-qf-QuW">
<rect key="frame" x="47" y="109" width="41" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Issuer" id="tAl-Qh-OR9">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VLG-f9-Gcl">
<rect key="frame" x="47" y="84" width="71" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Fingerprint" id="49l-Xk-MUH">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7">
<rect key="frame" x="47" y="206" width="344" height="17"/>
<constraints>
<constraint firstAttribute="width" constant="340" id="19"/>
</constraints>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Certificate for SERVER_NAME" placeholderString="" id="20">
<textFieldCell key="cell" scrollable="YES" sendsActionOnEndEditing="YES" title="Certificate for SERVER_NAME" placeholderString="" id="20">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
Expand All @@ -77,7 +52,7 @@ Gw
</connections>
</button>
<button verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9">
<rect key="frame" x="199" y="13" width="82" height="32"/>
<rect key="frame" x="302" y="13" width="82" height="32"/>
<constraints>
<constraint firstAttribute="width" constant="70" id="16"/>
</constraints>
Expand All @@ -92,67 +67,103 @@ DQ
<action selector="onAccept:" target="-2" id="522"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7I5-a2-h65">
<rect key="frame" x="197" y="13" width="105" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="Temporary" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="i6y-0u-COa">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<string key="keyEquivalent" base64-UTF8="YES">
</string>
</buttonCell>
<connections>
<action selector="onTemporary:" target="-2" id="BWk-o1-tug"/>
</connections>
</button>
<textField verticalHuggingPriority="750" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="LgQ-ni-jXv">
<rect key="frame" x="47" y="168" width="429" height="36"/>
<constraints>
<constraint firstAttribute="width" constant="102" id="ymW-Lu-B1W"/>
</constraints>
<textFieldCell key="cell" wraps="YES" alignment="center" lineBreakMode="clipping" scrollable="YES" sendsActionOnEndEditing="YES" title="ATTENTION: The common name does not match the server name!" id="94f-Om-tJh">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5">
<rect key="frame" x="47" y="118" width="51" height="17"/>
<textFieldCell key="cell" wraps="YES" alignment="center" lineBreakMode="clipping" scrollable="YES" sendsActionOnEndEditing="YES" title="Subject" id="22">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="vA4-qf-QuW">
<rect key="frame" x="47" y="93" width="41" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" wraps="YES" alignment="center" lineBreakMode="clipping" scrollable="YES" sendsActionOnEndEditing="YES" title="Issuer" id="tAl-Qh-OR9">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VLG-f9-Gcl">
<rect key="frame" x="47" y="68" width="71" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" wraps="YES" alignment="center" lineBreakMode="clipping" scrollable="YES" sendsActionOnEndEditing="YES" title="Fingerprint" id="49l-Xk-MUH">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="10">
<rect key="frame" x="47" y="159" width="106" height="17"/>
<rect key="frame" x="47" y="143" width="106" height="17"/>
<constraints>
<constraint firstAttribute="width" constant="102" id="14"/>
</constraints>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Common" id="15">
<textFieldCell key="cell" wraps="YES" alignment="center" lineBreakMode="clipping" scrollable="YES" sendsActionOnEndEditing="YES" title="Common" id="15">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="2HW-of-a4n">
<rect key="frame" x="140" y="159" width="305" height="17"/>
<rect key="frame" x="140" y="143" width="305" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="COMMON NAME" id="N48-2i-W6H">
<textFieldCell key="cell" wraps="YES" alignment="center" lineBreakMode="clipping" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="COMMON NAME" id="N48-2i-W6H">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="R9r-82-XAH">
<rect key="frame" x="140" y="134" width="305" height="17"/>
<rect key="frame" x="140" y="118" width="305" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="SUBJECT" id="iGw-oh-i3p">
<textFieldCell key="cell" wraps="YES" alignment="center" lineBreakMode="clipping" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="SUBJECT" id="iGw-oh-i3p">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="kHA-F4-dxw">
<rect key="frame" x="140" y="109" width="305" height="17"/>
<rect key="frame" x="140" y="93" width="305" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="ISSUER" id="daP-a0-hI1">
<textFieldCell key="cell" wraps="YES" alignment="center" lineBreakMode="clipping" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="ISSUER" id="daP-a0-hI1">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="cLB-ZO-jvx">
<rect key="frame" x="140" y="84" width="305" height="17"/>
<rect key="frame" x="140" y="49" width="329" height="36"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="FINGERPRINT" id="VqU-vO-noG">
<textFieldCell key="cell" wraps="YES" alignment="center" lineBreakMode="clipping" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="FINGERPRINT" id="VqU-vO-noG">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7I5-a2-h65">
<rect key="frame" x="281" y="13" width="105" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="Temporary" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="i6y-0u-COa">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<string key="keyEquivalent" base64-UTF8="YES">
Gw
</string>
</buttonCell>
<connections>
<action selector="onTemporary:" target="-2" id="BWk-o1-tug"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="8" firstAttribute="leading" secondItem="9" secondAttribute="trailing" id="32"/>
Expand Down

0 comments on commit 730b6f0

Please sign in to comment.