Post

Replies

Boosts

Views

Activity

RFB Protocol Security for VNC Client Implementation
I’m exploring the RFB protocol used by VNC connections on macOS. In the initial part of the handshake, as described in the spec - https://tools.ietf.org/html/rfc6143#section-7.2, the server returns a list of security types it supports. Connecting to my iMac running macOS 10.15.6, I get the following list: 30, 33, 36, 35. Looking at the IANA registrations for this protocol, 30-35 are assigned to Apple, and 36 is “Unassigned.” Are there any publicly-available resources to understand the security implementation of the built-in VNC server on macOS? I see a blog post about it from 2011 (I can’t add the link here for some reason), but nothing newer and I suspect the authentication methods have improved since then.
0
0
920
Jul ’20
Xcode 11.4 triggers “ThreadSanitizer CHECK failed” but doesn’t hit breakpoints
In my current iOS project, if I run with Xcode’s thread sanitizer enabled, sometimes I’ll get this in the console output and the app will halt:FATAL: ThreadSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clang_compiler_rt/clang-1103.0.32.29/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc:166 "((kBlockMagic)) == ((((u64*)addr)[0]))" (0x6a6cb03abcebc041, 0x0)This doesn’t hit the Thread Sanitizer runtime breakpoint, the “All Runtime Issues” breakpoint, the “All Exceptions” breakpoint, or the “Swift Error” breakpoint. My only fix so far has been to recompile with the Thread Sanitizer disabled. Anyone else seeing this?
7
0
2.4k
Apr ’20
ASWebAuthenticationSession, watchOS, and Cookies
I have an app that uses the Slack API, and I’m trying to use ASWebAuthenticationSession on watchOS 6.2 to allow for login on watchOS. I was able to display the login form and enter my username and password, then I saw this displayed:Unable to set cookie You need to enable cookies to sign in.Is this something Slack needs to account for, or is there a way for my ASWebAuthenticationSession on watchOS to enable cookies?
0
1
857
Feb ’20
UIWindow Keyboard Notifications for Hosted Content
I’m using the standard UIResponder keyboard notifications to observe when the keyboard appears and adjust the content inset of a scroll view so that its content is visible when scrolled all the way down. This works fine, same as it always has. However, this app is a Message app extension, so the window of my view controller is not the same size as the main UIScreen. The keyboard notification coordinates are in terms of the main screen, but the frames of all of my views are in terms of the window. The window is pinned to the bottom of the display, but its frame starts at 0, 0. Is there a way for me to programatically determine the position of this UIWindow in the UIScreen frame? Here’s the code I’m using:@objc func adjustKeyboard(for notification: Notification) { guard let scrollView = scrollView, let superview = scrollView.superview, let window = scrollView.window, let userInfo = notification.userInfo, let frameValue = userInfo[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue else { return } let frame = frameValue.cgRectValue let coordinateSpace = UIScreen.main.fixedCoordinateSpace let frameInSuperview = superview.convert(frame, from: coordinateSpace) // The window is at the bottom of the screen but its frame needs to be // adjusted for that difference let offset = scrollView.frame.maxY - frameInSuperview.minY + (coordinateSpace.bounds.height - window.frame.height) animate(alongsideKeyboardNotification: notification, animations: { print("Intersection height: \(offset)") scrollView.contentInset.bottom = offset scrollView.verticalScrollIndicatorInsets.bottom = offset }) } func animate(alongsideKeyboardNotification notification: Notification, animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) { let durationKey = UIResponder.keyboardAnimationDurationUserInfoKey let curveKey = UIResponder.keyboardAnimationCurveUserInfoKey guard let userInfo = notification.userInfo, let duration = (userInfo[durationKey] as? NSNumber)?.doubleValue, let curveValue = (userInfo[curveKey] as? NSNumber)?.intValue, let curve = UIView.AnimationCurve(rawValue: curveValue) else { animations() return } UIView.animate(withDuration: duration, delay: 0, options: curve.asOptions, animations: animations, completion: completion) } extension UIView.AnimationCurve { var asOptions: UIView.AnimationOptions { switch self { case .easeInOut: return .curveEaseInOut case .easeIn: return .curveEaseIn case .easeOut: return .curveEaseOut case .linear: return .curveLinear @unknown default: return [] } } }Ideally, I would not need line 19—which won’t work if, for instance, the window were at the top of the screen. I’d rather not hard-code it for that reason. Any ideas?
0
0
612
Jan ’20