This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Copyright 2018 Simon Grätzer | |
#include "client.h" | |
#include "defer.h" | |
#include <http_parser.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netdb.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jshint globalstrict:false, strict:false, maxlen: 500 */ | |
/*global assertEqual */ | |
//////////////////////////////////////////////////////////////////////////////// | |
/// @brief tests for query language, geo queries | |
/// | |
/// @file | |
/// | |
/// DISCLAIMER | |
/// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Building pjsip:" | |
# change this to whatever DEVPATH works | |
# if you get make errors, maybe redownload pjsip and try again | |
export DEVPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer | |
MIN_IOS="-miphoneos-version-min=9.0" ARCH="-arch i386" CFLAGS="-O2 -m32 -mios-simulator-version-min=9.0 -fembed-bitcode" LDFLAGS="-O2 -m32 -mios-simulator-version-min=9.0 -fembed-bitcode" ./configure-iphone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <CommonCrypto/CommonCrypto.h> | |
// ... | |
NSData * HKDF_SHA256(NSData *seed, NSData *info, NSData *salt, int outputSize) { | |
char prk[kCCHmacAlgSHA256] = {0}; | |
CCHmac(CC_SHA256_DIGEST_LENGTH, [salt bytes], [salt length], [seed bytes], [seed length], prk); | |
int iterations = (int)ceil((double)outputSize/(double)CC_SHA256_DIGEST_LENGTH); | |
NSData *mixin = [NSData data]; | |
NSMutableData *results = [NSMutableData data]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create the keys with SecKeyGeneratePair | |
// Look at https://developer.apple.com/library/ios/samplecode/CryptoExercise/Introduction/Intro.html | |
NSData* keyData = [self _getPublicKeyBits]; | |
NSLog(@"Public Key: %@", [keyData hexadecimalString]); | |
// http://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One#Example_encoded_in_DER | |
const char *buffer = keyData.bytes; | |
NSData* modulus; | |
NSData* exponent; | |
// Check for correct ASN.1 DER start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <CommonCrypto/CommonCrypto.h> | |
// ... | |
// http://www.opensource.apple.com/source/OpenSSL/OpenSSL-12/openssl/crypto/evp/p5_crpt2.c | |
// This is the method specified by RSA's PKCS #5 standard. | |
// Compatible to https://github.com/bitwiseshiftleft/sjcl/blob/master/core/pbkdf2.js | |
NSData * PBKDF2_HMAC_SHA256(NSData *data,NSData *salt, int iter, int keylen) { | |
unsigned char digtmp[CC_SHA256_DIGEST_LENGTH], *p, *buffer, itmp[4]; | |
NSInteger cplen, j, k, tkeylen; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tl=new Array( | |
"The requested document is no more.", | |
'No file found.', | |
"Even tried multi.", | |
"Nothing helped.", | |
"I'm really depressed about this.", | |
"You see, I'm just a web server...", | |
"-- here I am, brain the size of the universe,", | |
"trying to serve you a simple web page,", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import android.content.Context; | |
import android.os.Bundle; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentActivity; | |
import android.support.v4.app.FragmentPagerAdapter; | |
import android.support.v4.app.FragmentTransaction; | |
import android.support.v4.view.ViewPager; |