mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2025-07-23 12:44:19 +00:00
Merge branch 'master' of github.com:limelight-stream/limelight-ios
# By Cameron Gutman # Via Cameron Gutman * 'master' of github.com:limelight-stream/limelight-ios: Fix a compilation warning Fix a nasty bug that LLVM static analysis caught Fix some mostly harmless warnings from LLVM static analysis
This commit is contained in:
commit
cd709000d7
@ -41,7 +41,7 @@ static NSLock *controllerStreamLock;
|
|||||||
|
|
||||||
if (controller.extendedGamepad != NULL) {
|
if (controller.extendedGamepad != NULL) {
|
||||||
controller.extendedGamepad.valueChangedHandler = ^(GCExtendedGamepad *gamepad, GCControllerElement *element) {
|
controller.extendedGamepad.valueChangedHandler = ^(GCExtendedGamepad *gamepad, GCControllerElement *element) {
|
||||||
short buttonFlags;
|
short buttonFlags = 0;
|
||||||
short leftStickX, leftStickY;
|
short leftStickX, leftStickY;
|
||||||
short rightStickX, rightStickY;
|
short rightStickX, rightStickY;
|
||||||
char leftTrigger, rightTrigger;
|
char leftTrigger, rightTrigger;
|
||||||
@ -78,7 +78,7 @@ static NSLock *controllerStreamLock;
|
|||||||
}
|
}
|
||||||
else if (controller.gamepad != NULL) {
|
else if (controller.gamepad != NULL) {
|
||||||
controller.gamepad.valueChangedHandler = ^(GCGamepad *gamepad, GCControllerElement *element) {
|
controller.gamepad.valueChangedHandler = ^(GCGamepad *gamepad, GCControllerElement *element) {
|
||||||
short buttonFlags;
|
short buttonFlags = 0;
|
||||||
|
|
||||||
UPDATE_BUTTON(A_FLAG, gamepad.buttonA.pressed);
|
UPDATE_BUTTON(A_FLAG, gamepad.buttonA.pressed);
|
||||||
UPDATE_BUTTON(B_FLAG, gamepad.buttonB.pressed);
|
UPDATE_BUTTON(B_FLAG, gamepad.buttonB.pressed);
|
||||||
|
@ -119,13 +119,12 @@ static NSData* p12 = nil;
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ret = -1;
|
|
||||||
EVP_MD_CTX *mdctx = NULL;
|
EVP_MD_CTX *mdctx = NULL;
|
||||||
mdctx = EVP_MD_CTX_create();
|
mdctx = EVP_MD_CTX_create();
|
||||||
ret = EVP_DigestSignInit(mdctx, NULL, EVP_sha256(), NULL, pkey);
|
EVP_DigestSignInit(mdctx, NULL, EVP_sha256(), NULL, pkey);
|
||||||
ret = EVP_DigestSignUpdate(mdctx, [data bytes], [data length]);
|
EVP_DigestSignUpdate(mdctx, [data bytes], [data length]);
|
||||||
size_t slen;
|
size_t slen;
|
||||||
ret = EVP_DigestSignFinal(mdctx, NULL, &slen);
|
EVP_DigestSignFinal(mdctx, NULL, &slen);
|
||||||
unsigned char* signature = malloc(slen);
|
unsigned char* signature = malloc(slen);
|
||||||
int result = EVP_DigestSignFinal(mdctx, signature, &slen);
|
int result = EVP_DigestSignFinal(mdctx, signature, &slen);
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
static const NSString* PORT = @"47984";
|
static const NSString* PORT = @"47984";
|
||||||
|
|
||||||
+ (NSString*) getStringFromXML:(NSData*)xml tag:(NSString*)tag {
|
+ (NSString*) getStringFromXML:(NSData*)xml tag:(NSString*)tag {
|
||||||
xmlDocPtr docPtr = xmlParseMemory([xml bytes], [xml length]);
|
xmlDocPtr docPtr = xmlParseMemory([xml bytes], (int)[xml length]);
|
||||||
|
|
||||||
if (docPtr == NULL) {
|
if (docPtr == NULL) {
|
||||||
NSLog(@"ERROR: An error occured trying to parse xml.");
|
NSLog(@"ERROR: An error occured trying to parse xml.");
|
||||||
@ -184,9 +184,8 @@ static const NSString* PORT = @"47984";
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {
|
- (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {
|
||||||
SecIdentityRef identity = [self getClientCertificate]; // Go get a SecIdentityRef
|
SecIdentityRef identity = [self getClientCertificate];
|
||||||
CFArrayRef certs = [self getCertificate:identity]; // Get an array of certificates
|
NSArray *certArray = [self getCertificate:identity];
|
||||||
NSArray *certArray = (__bridge NSArray *)certs;
|
|
||||||
|
|
||||||
NSURLCredential *newCredential = [NSURLCredential credentialWithIdentity:identity certificates:certArray persistence:NSURLCredentialPersistencePermanent];
|
NSURLCredential *newCredential = [NSURLCredential credentialWithIdentity:identity certificates:certArray persistence:NSURLCredentialPersistencePermanent];
|
||||||
|
|
||||||
@ -194,22 +193,12 @@ static const NSString* PORT = @"47984";
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns an array containing the certificate
|
// Returns an array containing the certificate
|
||||||
- (CFArrayRef)getCertificate:(SecIdentityRef) identity {
|
- (NSArray*)getCertificate:(SecIdentityRef) identity {
|
||||||
SecCertificateRef certificate = nil;
|
SecCertificateRef certificate = nil;
|
||||||
|
|
||||||
SecIdentityCopyCertificate(identity, &certificate);
|
SecIdentityCopyCertificate(identity, &certificate);
|
||||||
SecCertificateRef certs[1] = { certificate };
|
|
||||||
|
|
||||||
CFArrayRef certArray = CFArrayCreate(NULL, (const void **) certs, 1, NULL);
|
return [[NSArray alloc] initWithObjects:(__bridge id)certificate, nil];
|
||||||
|
|
||||||
SecPolicyRef policyRef = SecPolicyCreateBasicX509();
|
|
||||||
SecTrustRef trustRef;
|
|
||||||
|
|
||||||
OSStatus status = SecTrustCreateWithCertificates(certArray, policyRef, &trustRef);
|
|
||||||
if (status != noErr) {
|
|
||||||
NSLog(@"Error Creating certificate");
|
|
||||||
}
|
|
||||||
return certArray;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the identity
|
// Returns the identity
|
||||||
|
@ -83,7 +83,7 @@ int mkcert(X509 **x509p, EVP_PKEY **pkeyp, int bits, int serial, int years) {
|
|||||||
RSA *rsa;
|
RSA *rsa;
|
||||||
X509_NAME *name = NULL;
|
X509_NAME *name = NULL;
|
||||||
|
|
||||||
if ((pkeyp == NULL) || (*pkeyp == NULL)) {
|
if (*pkeyp == NULL) {
|
||||||
if ((pk=EVP_PKEY_new()) == NULL) {
|
if ((pk=EVP_PKEY_new()) == NULL) {
|
||||||
abort();
|
abort();
|
||||||
return(0);
|
return(0);
|
||||||
@ -92,7 +92,7 @@ int mkcert(X509 **x509p, EVP_PKEY **pkeyp, int bits, int serial, int years) {
|
|||||||
pk = *pkeyp;
|
pk = *pkeyp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((x509p == NULL) || (*x509p == NULL)) {
|
if (*x509p == NULL) {
|
||||||
if ((x = X509_new()) == NULL) {
|
if ((x = X509_new()) == NULL) {
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user