[vlc-devel] [PATCH 5/6] keychain: store the realm
Thomas Guillem
thomas at gllm.fr
Thu Oct 31 15:38:11 CET 2019
Used for SMB domains.
Needed for the test_modules_keystore success.
---
modules/keystore/keychain.m | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/modules/keystore/keychain.m b/modules/keystore/keychain.m
index 779196090b7..2051082669d 100644
--- a/modules/keystore/keychain.m
+++ b/modules/keystore/keychain.m
@@ -228,6 +228,7 @@ static int SetAttributesForQuery(const char *const ppsz_values[KEY_MAX], NSMutab
const char *psz_server = ppsz_values[KEY_SERVER];
const char *psz_path = ppsz_values[KEY_PATH];
const char *psz_port = ppsz_values[KEY_PORT];
+ const char *psz_realm = ppsz_values[KEY_REALM];
if (psz_label) {
[query setObject:[NSString stringWithUTF8String:psz_label] forKey:(__bridge id)kSecAttrLabel];
@@ -263,6 +264,9 @@ static int SetAttributesForQuery(const char *const ppsz_values[KEY_MAX], NSMutab
if (psz_port) {
[query setObject:[NSNumber numberWithInt:atoi(psz_port)] forKey:(__bridge id)kSecAttrPort];
}
+ if (psz_realm) {
+ [query setObject:[NSString stringWithUTF8String:psz_realm] forKey:(__bridge id)kSecAttrSecurityDomain];
+ }
return VLC_SUCCESS;
}
@@ -311,6 +315,10 @@ static int FillEntryValues(const NSDictionary *item, char *ppsz_values[KEY_MAX])
if (port)
SET_NSNBR(KEY_PORT, port);
+ NSString *realm = [item objectForKey:(__bridge id)kSecAttrSecurityDomain];
+ if (realm)
+ SET_NSSTR(KEY_REALM, realm);
+
return VLC_SUCCESS;
}
--
2.20.1
More information about the vlc-devel
mailing list