Skip to content

Commit e46b17e

Browse files
Use myJID domain for cert pinning dialog. Fixes #1079
1 parent 2137a95 commit e46b17e

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

ChatSecure/Classes/Utilities/OTRCertificatePinning.m

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -299,14 +299,7 @@ + (id)publicKeyWithCertData:(NSData *)certData
299299

300300
- (void)xmppStream:(XMPPStream *)sender didReceiveTrust:(SecTrustRef)trust completionHandler:(void (^)(BOOL))completionHandler
301301
{
302-
NSString *hostName = nil;
303-
if ([sender isKindOfClass:[OTRXMPPStream class]]) {
304-
OTRXMPPStream *otrStream = (OTRXMPPStream*)sender;
305-
hostName = otrStream.connectedHostName;
306-
} else {
307-
completionHandler(NO);
308-
@throw [NSException exceptionWithName:NSInternalInconsistencyException reason:@"XMPPStream is of wrong class! Expected OTRXMPPStream." userInfo:nil];
309-
}
302+
NSString *hostName = sender.myJID.domain;
310303
// We should have a hostName. If we don't, something is wrong.
311304
NSParameterAssert(hostName.length > 0);
312305
if (!hostName.length) {

0 commit comments

Comments
 (0)