Skip to content

Instantly share code, notes, and snippets.

View dmaclach's full-sized avatar

dmaclach dmaclach

View GitHub Profile
@dmaclach
dmaclach / gist:a0f51212e871e19165c6b970bc7158fb
Created April 23, 2025 02:27
Code snippet for converting between OpenSSL types and SecKeyRefs. Hacky, but it worked for my needs.
uint8_t get_EC_curve(const EC_key_t ec)
{
int nid;
nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec));
return get_ec_curve_type(nid);
}
static EC_KEY *SecKeyToOpenSSLKey(SecKeyRef secKey, int public) {
CFErrorRef error;
@dmaclach
dmaclach / gist:d9ed160e0f1d5537cc5f96cc50663780
Created May 13, 2025 16:12
Environment variables for controlling/diagnosing the OSX Objective-C runtime.
From MacOS Sequoia (15.5 - 24F74)
dmaclach-mac2:~ dmaclach$ export OBJC_HELP=1
dmaclach-mac2:~ dmaclach$ get
objc[31594]: Objective-C runtime debugging. Set variable=YES to enable.
objc[31594]: OBJC_HELP: describe available environment variables
objc[31594]: OBJC_PRINT_OPTIONS: list which options are set
objc[31594]: OBJC_PRINT_IMAGES: log image and library names as they are loaded
objc[31594]: OBJC_PRINT_LOAD_METHODS: log calls to class and category +load methods
objc[31594]: OBJC_PRINT_INITIALIZE_METHODS: log calls to class +initialize methods
objc[31594]: OBJC_PRINT_RESOLVED_METHODS: log methods created by +resolveClassMethod: and +resolveInstanceMethod: