1
votes

I am trying to run the sample code shared by IBM for FIPS on device.

While running I am getting the below error.
Any idea why?

/Users/ctsmacminibtp5ne35/Library/Developer/Xcode/DerivedData/JSONStoreEncryptingSensitiveDataWithFIPSProject-1SampleIphone-cqxfkcnledkobshgrkgsluzvxofu/Build/Intermediates/JSONStoreEncryptingSensitiveDataWithFIPSProject-1SampleIphone.build/Debug-iphoneos/JSONStoreEncryptingSensitiveDataWithFIPSProject-1SampleIphone.build/Script-427B829D1393724500F223DC.sh: line 8: /Users/ctsmacminibtp5ne35/Desktop/NativeCode/JSONStoreEncryptingSensitiveDataWithFIPSProject-1/apps/Sample/iphone/native/: is a directory DONE with script: (exitStatus=126)\n\n /Users/ctsmacminibtp5ne35/Library/Developer/Xcode/DerivedData/JSONStoreEncryptingSensitiveDataWithFIPSProject-1SampleIphone-cqxfkcnledkobshgrkgsluzvxofu/Build/Intermediates/JSONStoreEncryptingSensitiveDataWithFIPSProject-1SampleIphone.build/Debug-iphoneos/JSONStoreEncryptingSensitiveDataWithFIPSProject-1SampleIphone.build/Script-427B829D1393724500F223DC.sh: line 12: 1604 Segmentation fault: 11 /usr/local/bin/incore_macho -exe "$CONFIGURATION_BUILD_DIR/$EXECUTABLE_PATH" Command /bin/sh failed with exit code 126

Reference Code Link: http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v600/JSONStoreEncryptingSensitiveDataWithFIPSProject.zip

PDF link: http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v600/05_12_JSONStore_-_Encrypting_sensitive_data_with_FIPS.pdf

enter image description hereenter image description here

1
Which version of worklight are you using? - jnortey
Also, a link the the exact sample you are using would be helpful. - jnortey
Using the sample in the provided link and following the PDF, I could not reproduce your error. FIPS mode was successfully enabled for me. The seg fault is happening at build time, not during run time, correct? What architecture are you building for? Can you please provide as much information as possible about the machine you're using and the iOS device you are trying to build for? - jnortey
@jnortey, I am using standard i386 and armv7 architechture while building. also i am getting this error on build itself. Also can you share the sample code running on your mac over github. please let me know if this can be done. - Max
This is odd...I don't think sharing the project will help us much. The incore macho execution is failing on your machine but I'm not sure why. What version of OSX are you running? I'm running this on 10.9.2. - jnortey

1 Answers

2
votes

It appears that the incore_macho that comes bundled with the sample was built using an OSX version later than 10.7.5 (though I can't confirm what version it was built with at this time). You can build your own incore_macho file by doing the following steps:

1. Go to the following site:

http://openssl.com/fips/2.0/platforms/ios/

and download the following files:

ios-incore-2.0.1.tar.gz
setenv-reset.sh
setenv-darwin-i386.sh

2. Untar ios-incore-2.0.1.tar.gz. It will produce the following file structure:

openssl-fips-2.0.1/iOS

3. cd into the iOS folder

4. Run the two downloaded scripts:

.  ./setenv-reset.sh
.  ./setenv-darwin-i386.sh

5. Run 'make' inside the iOS file.

This will produce a new incore_macho file built for your system. You can confirm the utility works by running ./incore_macho.

For more in depth instructions, see page 124 of the FIPS User Guide