iphone - OpenSSL RAND_byte issue with iOS Simulator -


i have downloaded latest source openssl page (released on april 7th, 2014), , created libcrypto.a library using tutorial have followed steps in run ./build-openssl.sh script file generate libcrypto.a file environments (armv7s, armv7, i386) on mac os x having version 10.9.2.

i able encrypt / decrypt date using evp_aes_256_cbc encryption code gets failed when try rand_byte. code gets crashed on rand_byte call.

below codes, trying rand_byte seeds:

// code 1

unsigned char seed[32]; rand_bytes(seed, 32); 

// code 2

int count = 24; unsigned char *buffer = (unsigned char *)calloc(count, sizeof(unsigned char)); rand_bytes(buffer, count); 

// code 3

int count = 24; unsigned char *buffer = (unsigned char *)malloc(sizeof(int)*count); rand_bytes(buffer, count); 

// code 4

int count = 24; unsigned char *buffer = openssl_malloc(count); rand_bytes(buffer, count); 

when run above code on ios 6.0/6.1 simulator, gets crashed on rand_byte call , “_interposition_vtable_unimplemented” on thread 1 , no message displayed on console.

when run same code on ios 7.0+ simulator, gets crashed on rand_byte call , “__pthread_kill” on thread 1 , “detected attempt call symbol in system libraries not present on iphone: open$unix2003 called function rand_poll in image cryptographytest.” on console.

but when run same code on ipad ios 7.0.4, above codes runs perfectly. return value rand_byte 1.

i don’t understand behavior of functions not work on ios simulator works ios devices.

any highly appreciated! many in advance.

... using tutorial have followed steps in run ./build-openssl.sh script file generate libcrypto.a file environments (armv7s, armv7, i386)  ... don’t understand behavior of functions not work on ios simulator works ios devices. 

the script wrong usage:

enter image description here

its not building simulator. building desktop. this:

archs=("armv7s" "armv7" "i386") sdks=("iphoneos" "iphoneos" "macosx") 

probably needs changed to:

archs=("armv7s" "armv7" "i386") sdks=("iphoneos" "iphoneos" "iphonesimulator") 

with iphonesimulator, proper sdk used:

$ ls /applications/xcode.app/contents/developer/platforms/ macosx.platform         iphonesimulator.platform iphoneos.platform 

does project using claim multi-arch , iphone , iphone simulator? or claim multi-arch , iphone , os x?


Comments

Popular posts from this blog

jQuery Mobile app not scrolling in Firefox -

c++ - How to add Crypto++ library to Qt project -

php array slice every 2th rule -