ios test
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// HttpDnsLocker.h
|
||||
// TrustHttpDNS
|
||||
// NewHttpDNS
|
||||
//
|
||||
// Created by 王贇 on 2023/8/16.
|
||||
// Copyright © 2023 trustapp.com. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// HttpDnsLocker.m
|
||||
// TrustHttpDNS
|
||||
// NewHttpDNS
|
||||
//
|
||||
// Created by 王贇 on 2023/8/16.
|
||||
// Copyright © 2023 trustapp.com. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// HttpdnsHostObjectInMemoryCache.h
|
||||
// TrustHttpDNS
|
||||
// NewHttpDNS
|
||||
//
|
||||
// Created by xuyecan on 2024/9/28.
|
||||
// Copyright © 2024 trustapp.com. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// HttpdnsHostObjectInMemoryCache.m
|
||||
// TrustHttpDNS
|
||||
// NewHttpDNS
|
||||
//
|
||||
// Created by xuyecan on 2024/9/28.
|
||||
// Copyright © 2024 trustapp.com. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// HttpdnsIPQualityDetector.h
|
||||
// TrustHttpDNS
|
||||
// NewHttpDNS
|
||||
//
|
||||
// Created by xuyecan on 2025/3/13.
|
||||
// Copyright © 2025 trustapp.com. All rights reserved.
|
||||
|
||||
@@ -259,8 +259,8 @@
|
||||
// 检查输入参<EFBFBD><EFBFBD>?
|
||||
if (plaintext == nil || [plaintext length] == 0 || key == nil || [key length] != kCCKeySizeAES128) {
|
||||
if (error) {
|
||||
*error = [NSError errorWithDomain:Trust_HTTPDNS_ERROR_DOMAIN
|
||||
code:Trust_HTTPDNS_ENCRYPT_INVALID_PARAMS_ERROR_CODE
|
||||
*error = [NSError errorWithDomain:NEW_HTTPDNS_ERROR_DOMAIN
|
||||
code:NEW_HTTPDNS_ENCRYPT_INVALID_PARAMS_ERROR_CODE
|
||||
userInfo:@{NSLocalizedDescriptionKey: @"Invalid input parameters"}];
|
||||
}
|
||||
return nil;
|
||||
@@ -271,8 +271,8 @@
|
||||
int result = SecRandomCopyBytes(kSecRandomDefault, kCCBlockSizeAES128, iv.mutableBytes);
|
||||
if (result != 0) {
|
||||
if (error) {
|
||||
*error = [NSError errorWithDomain:Trust_HTTPDNS_ERROR_DOMAIN
|
||||
code:Trust_HTTPDNS_ENCRYPT_RANDOM_IV_ERROR_CODE
|
||||
*error = [NSError errorWithDomain:NEW_HTTPDNS_ERROR_DOMAIN
|
||||
code:NEW_HTTPDNS_ENCRYPT_RANDOM_IV_ERROR_CODE
|
||||
userInfo:@{NSLocalizedDescriptionKey: @"Failed to generate random IV"}];
|
||||
}
|
||||
return nil;
|
||||
@@ -301,8 +301,8 @@
|
||||
|
||||
if (cryptStatus != kCCSuccess) {
|
||||
if (error) {
|
||||
*error = [NSError errorWithDomain:Trust_HTTPDNS_ERROR_DOMAIN
|
||||
code:Trust_HTTPDNS_ENCRYPT_FAILED_ERROR_CODE
|
||||
*error = [NSError errorWithDomain:NEW_HTTPDNS_ERROR_DOMAIN
|
||||
code:NEW_HTTPDNS_ENCRYPT_FAILED_ERROR_CODE
|
||||
userInfo:@{NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Encryption failed with status: %d", cryptStatus]}];
|
||||
}
|
||||
return nil;
|
||||
@@ -394,8 +394,8 @@
|
||||
// 检查输入参<EFBFBD><EFBFBD>?
|
||||
if (ciphertext == nil || [ciphertext length] <= kCCBlockSizeAES128 || key == nil || [key length] != kCCKeySizeAES128) {
|
||||
if (error) {
|
||||
*error = [NSError errorWithDomain:Trust_HTTPDNS_ERROR_DOMAIN
|
||||
code:Trust_HTTPDNS_ENCRYPT_INVALID_PARAMS_ERROR_CODE
|
||||
*error = [NSError errorWithDomain:NEW_HTTPDNS_ERROR_DOMAIN
|
||||
code:NEW_HTTPDNS_ENCRYPT_INVALID_PARAMS_ERROR_CODE
|
||||
userInfo:@{NSLocalizedDescriptionKey: @"Invalid input parameters for decryption"}];
|
||||
}
|
||||
return nil;
|
||||
@@ -427,8 +427,8 @@
|
||||
|
||||
if (cryptStatus != kCCSuccess) {
|
||||
if (error) {
|
||||
*error = [NSError errorWithDomain:Trust_HTTPDNS_ERROR_DOMAIN
|
||||
code:Trust_HTTPDNS_ENCRYPT_FAILED_ERROR_CODE
|
||||
*error = [NSError errorWithDomain:NEW_HTTPDNS_ERROR_DOMAIN
|
||||
code:NEW_HTTPDNS_ENCRYPT_FAILED_ERROR_CODE
|
||||
userInfo:@{NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Decryption failed with status: %d", cryptStatus]}];
|
||||
}
|
||||
return nil;
|
||||
@@ -453,14 +453,14 @@
|
||||
|
||||
if (dnsService.ttlDelegate && [dnsService.ttlDelegate respondsToSelector:@selector(httpdnsHost:ipType:ttl:)]) {
|
||||
if ([self isNotEmptyArray:[hostObject getV4Ips]]) {
|
||||
int64_t customV4TTL = [dnsService.ttlDelegate httpdnsHost:host ipType:TrustHttpDNS_IPTypeV4 ttl:hostObject.v4ttl];
|
||||
int64_t customV4TTL = [dnsService.ttlDelegate httpdnsHost:host ipType:NewHttpDNS_IPTypeV4 ttl:hostObject.v4ttl];
|
||||
if (customV4TTL > 0) {
|
||||
hostObject.v4ttl = customV4TTL;
|
||||
}
|
||||
}
|
||||
|
||||
if ([self isNotEmptyArray:[hostObject getV6Ips]]) {
|
||||
int64_t customV6TTL = [dnsService.ttlDelegate httpdnsHost:host ipType:TrustHttpDNS_IPTypeV6 ttl:hostObject.v6ttl];
|
||||
int64_t customV6TTL = [dnsService.ttlDelegate httpdnsHost:host ipType:NewHttpDNS_IPTypeV6 ttl:hostObject.v6ttl];
|
||||
if (customV6TTL > 0) {
|
||||
hostObject.v6ttl = customV6TTL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user