|
14 | 14 | #include <cstdio> |
15 | 15 |
|
16 | 16 | #import <AVFoundation/AVFoundation.h> |
| 17 | +#import <Security/Security.h> |
17 | 18 | extern "C" { |
18 | 19 | #include <mpv/client.h> |
19 | 20 | } |
@@ -99,8 +100,21 @@ int secureStoreSmoke(int argc, char **argv) |
99 | 100 | const bool removed = Spool::CredentialStore::load(account).isEmpty(); |
100 | 101 | QTemporaryFile data(QDir(Spool::persistentDataRoot()).filePath(QStringLiteral("smoke-XXXXXX"))); |
101 | 102 | const bool writable = data.open() && data.write("sandbox") == 7 && data.flush(); |
102 | | - if (!saved || !loaded || !removed || !writable) |
| 103 | + if (!saved || !loaded || !removed || !writable) { |
| 104 | + std::fprintf(stderr, "tvOS credentials smoke: saved=%d loaded=%d removed=%d writable=%d\n", |
| 105 | + saved, loaded, removed, writable); |
| 106 | + // Read the actual native status without logging any account/value. |
| 107 | + NSDictionary *query = @{ (__bridge id)kSecClass: (__bridge id)kSecClassGenericPassword, |
| 108 | + (__bridge id)kSecAttrService: @SPOOL_APPLE_CREDENTIAL_SERVICE, |
| 109 | + (__bridge id)kSecAttrAccount: [NSString stringWithUTF8String:account.toUtf8().constData()], |
| 110 | + (__bridge id)kSecReturnData: @YES }; |
| 111 | + CFTypeRef result = nullptr; |
| 112 | + const OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, &result); |
| 113 | + if (result) |
| 114 | + CFRelease(result); |
| 115 | + std::fprintf(stderr, "tvOS credentials smoke: nativeStatus=%d\n", int(status)); |
103 | 116 | return 1; |
| 117 | + } |
104 | 118 | std::fprintf(stderr, "tvOS credentials smoke: Keychain roundtrip and sandbox file persistence passed\n"); |
105 | 119 | return 0; |
106 | 120 | } |
|
0 commit comments