Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wipe Secure Cell key copy on deallocation #612

Merged
merged 1 commit into from
Mar 27, 2020

Commits on Mar 26, 2020

  1. Wipe Secure Cell key copy on deallocation

    Secure Cell currently makes a copy of the master key it was given. Since
    Objective-C is fairly low level and exposes the "key" property, it makes
    sense to wipe the sensitive key from memory when it can no longer be
    used by Secure Cell.
    
    Do so by changing the underlying property type to NSMutableData and
    calling the wiping code in "dealloc" of TSCell.
    
    While we're here, improve API docs of the basic Secure Cell class that
    actually stores the key.
    
    Note that in Objective-C the "key" property returns NSData which
    respects retain-release mechanics so the users get a reference to
    the same data object as used by Secure Cell. However, in Swift NSData
    is bridged into Data type which has value semantics and effectively
    copies our copy of the key. We obviously cannot and should not wipe
    the copies we are not aware of, so this is a best effort approach.
    ilammy committed Mar 26, 2020
    Configuration menu
    Copy the full SHA
    bb1315e View commit details
    Browse the repository at this point in the history