Giter VIP home page Giter VIP logo

openssl-pod's Introduction

OpenSSL-Pod

Version numbering

Because OpenSSL's version numbers are not compatible with the CocoaPods version numbering, we will agree on the following.

OpenSSL version: A.B.CD will become A.B.C*100 + place of D in the alphabeth.

Example: OpenSSL 1.0.1h => OpenSSL 1.0.108

Keeping the pod up-to-date

With the new Cocoapods "trunk" system, a Pod has a maintainer. Being the maintainer of the OpenSSL pod, I will try my best to keep it updated. If however, you see that the Pod is way behind, please submit a pull request with the changes and I'll submit it to Trunk after review.

openssl-pod's People

Contributors

cdzombak avatar fredericjacobs avatar frugghi avatar kekiefer avatar michaelkirk avatar postmechanical avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

openssl-pod's Issues

Problem in a private key conversion from JWK to PEM formats

Hello,

I'm trying to convert a private key from JWK format (JSON) to PEM format using the openSSL library. My problem is an error in the result since it has an invalid format when I try to check the result with the openssl command line tool. I don't know if I have to ask here or in the official/original openssl repo, but maybe someone can give some guide to solve the error.

The JWK used is the following:

jwk = { "p": "yZnnC4tGxAeu7G-N-zxb8dOpHrk88VsXRoNH1sj54CIwj-y77amx4J6WCw_y7A9L_K3Fpn3Cbje5MNQJlizDLg8NdKWfC2yntkZD8SVEbU1EshDj8tWhMZSkKp3P7KM1ht1b8Okban9QNSnx-2y7Emtd2x78zjAFJt66yJGSx_k", "d": "KzmTm_rtw555d5ztEocm5Jb2gxDucsLLecWbDTlDZuJqifLVhrmhw8k9Pvenl5aw4jBBZmS2IDbc3uF5gs1gtujcELSPcJ__12ed4-vexWEkGdqNWSMvxwfvXrU5Gv_08Hj6zbORMt9OzvYdbRJrhv0UOJ4wvWSrQ_BrEPG4FXcJKuTFvQ4n2lckacmXlAgyZmAdeldU6C9s-st-vfJ25OabFVo8FyP7pa92KS-EgDTUTUJXqczNHYJbfWKVbAs9nBnDnU3ulE2pm48LHbgqeS2tejvIIIZ47bGRWudgbpeFamXPEf0Ow3AYNntTXCpKKdRN--XK5vAx2riw7LuWuQ", "q": "1xZNBiXqqgNuMNyw8YqS4ByN57XD00E9LH_HU54eL6sCkU6DM7Echpy2k5rIi6rs1_HxjS9pOcepqV4LE-0Q0_rwjGz7xWtZy0pCN1-nxWcHtC-BriBr2UE2_4VYIIo-UYVT3Vbyx8jyIWfJ_a4wiE083nGjf3OPvFP9ptZY_wM", "n": "qWHQ7K7sVNWb4QZe2TFdDeOH3zwYVU8aGWkh9KmUSadpBLpWheg0jhAx9v9-67cN-yJxHM02SOQmghk3aFKG_u39tm3rxGLrlEMIirUTY9Z60oaM9NOV9Q0Z5sSdNILfeMcZ01MrHlqJC_IjTPANPyhn3i2W4ZlgnmQLvvUvpUDwYexOB33e_DZf64OW7DOjh2qlNhTYxxo3fKJAA-C_dCL5IHL5TWYHrlULO7bVIisflUNjhyfEWcfRB8_XfN2-2NcBawp-OIbzPpik3mVNKuIYcf7JjVKgcJP7DYvzCGyoplTQOrcekSIO6UhXqc4Dd8tn0lXRIPBV1ndvzYFe6w", "kid": "DIEalhwEKmalZljtgVHdWqobAnBhLpjnMdGw9yFNNEs", "kty": "RSA", "use": "sig", "e": "AQAB" }

And this is the method that I have implemented to do the conversion:

`
+(NSString *) convertFromJWKtoPEM_PrivateKey: (NSDictionary *)jwk passphrase:(NSString *)passphrase {

NSLog(@"- starting convertFromJWKtoPEM_PrivateKey");
RSA * rsaKey = RSA_new();

ENGINE * rsaEngine = ENGINE_new();
//ENGINE_get_default_RSA();
int eng_init_result = ENGINE_init(rsaEngine);
if (eng_init_result == 0)
    NSLog(@"Error initializing the rsaEngine");

rsaKey->engine = rsaEngine;

BIGNUM *n_bn = NULL, *e_bn = NULL;
BIGNUM *d_bn = NULL, *p_bn = NULL, *q_bn = NULL;

e_bn = BN_new();
n_bn = BN_new();
d_bn = BN_new();
p_bn = BN_new();
q_bn = BN_new();

NSString * ezu = [jwk objectForKey:@"e"]; // public exponent
NSString * nzu = [jwk objectForKey:@"n"]; // public modulus
NSString * dzu = [jwk objectForKey:@"d"]; // private exponent
NSString * pzu = [jwk objectForKey:@"p"]; // secret prime factor
NSString * qzu = [jwk objectForKey:@"q"]; // secret prime factor

NSString *nz = [MF_Base64Codec base64StringFromBase64UrlEncodedString:nzu];
NSData *nn = [[NSData alloc]
              initWithBase64EncodedString:nz
              options:0];

NSString *ez = [MF_Base64Codec base64StringFromBase64UrlEncodedString:ezu];
NSData *en = [[NSData alloc]
              initWithBase64EncodedString:ez
              options:0];

NSString *dz = [MF_Base64Codec base64StringFromBase64UrlEncodedString:dzu];
NSData *dn = [[NSData alloc]
              initWithBase64EncodedString:dz
              options:0];

NSString *pz = [MF_Base64Codec base64StringFromBase64UrlEncodedString:pzu];
NSData *pn = [[NSData alloc]
              initWithBase64EncodedString:pz
              options:0];

NSString *qz = [MF_Base64Codec base64StringFromBase64UrlEncodedString:qzu];
NSData *qn = [[NSData alloc]
              initWithBase64EncodedString:qz
              options:0];

NSString * ehexString = [self NSDataToHex:en];
NSString * nhexString = [self NSDataToHex:nn];
NSString * dhexString = [self NSDataToHex:dn];
NSString * phexString = [self NSDataToHex:pn];
NSString * qhexString = [self NSDataToHex:qn];

NSLog(@"load param n: \n%@", nz);
NSLog(@"load param e: \n%@", ez);
NSLog(@"load param d: \n%@", dz);
NSLog(@"load param d: \n%@", pz);
NSLog(@"load param d: \n%@", qz);
NSLog(@"nn converted from b64urlformat: %@", nn.debugDescription);
NSLog(@"en converted from b64urlformat: %@", en.debugDescription);
NSLog(@"dn converted from b64urlformat: %@", dn.debugDescription);
NSLog(@"pn converted from b64urlformat: %@", pn.debugDescription);
NSLog(@"qn converted from b64urlformat: %@", qn.debugDescription);
NSLog(@"en converted to hexadecimal: %@", ehexString);
NSLog(@"nn converted to hexadecimal: %@", nhexString);
NSLog(@"dn converted to hexadecimal: %@", dhexString);
NSLog(@"pn converted to hexadecimal: %@", phexString);
NSLog(@"qn converted to hexadecimal: %@", qhexString);

const char *e_char = [ehexString UTF8String];
const char *n_char = [nhexString UTF8String];
const char *d_char = [dhexString UTF8String];
const char *p_char = [phexString UTF8String];
const char *q_char = [qhexString UTF8String];

//int BN_hex2bn(BIGNUM **a, const char *str);
int res1 = BN_hex2bn(&e_bn, e_char);
int res2 = BN_hex2bn(&n_bn, n_char);
int res3 = BN_hex2bn(&d_bn, d_char);
int res4 = BN_hex2bn(&p_bn, p_char);
int res5 = BN_hex2bn(&q_bn, q_char);

rsaKey->e = e_bn;
rsaKey->n = n_bn;
rsaKey->d = d_bn;
rsaKey->p = p_bn;
rsaKey->q = q_bn;

////////// DEBUG //////////
NSString * tmpRSAFilePath = [NSTemporaryDirectory() stringByAppendingPathComponent: [NSString stringWithFormat: @"%.0f.%@", [NSDate timeIntervalSinceReferenceDate] * 1000.0, @"txt"]];
FILE *tmpRSAFile = fopen([tmpRSAFilePath cStringUsingEncoding:NSUTF8StringEncoding], "w+");

int rsa_print = RSA_print_fp(tmpRSAFile, rsaKey, 0);
fclose(tmpRSAFile);
NSString * fileContents = [NSString stringWithContentsOfFile:tmpRSAFilePath encoding:NSUTF8StringEncoding error:nil];
NSLog(@"RSA_print_fp:\n%@", fileContents);
/////////////////

NSString * tmpPEMFilePath = [NSTemporaryDirectory() stringByAppendingPathComponent: [NSString stringWithFormat: @"%.0f.%@", [NSDate timeIntervalSinceReferenceDate] * 1000.0, @"txt"]];
FILE *tmpPEMFile = fopen([tmpPEMFilePath cStringUsingEncoding:NSUTF8StringEncoding], "w+");
int res_conversion = PEM_write_RSAPrivateKey(tmpPEMFile, rsaKey, nil, nil, 0, nil, nil);
fclose(tmpPEMFile);
NSLog(@"Conversion result form RSA to PEM (private key): %d", res_conversion);

// read the contents into a string
NSString *pemStr = [[NSString alloc]initWithContentsOfFile:tmpPEMFilePath encoding:NSUTF8StringEncoding error:nil];
NSLog(@ PEM Private String content:\n%@", pemStr);

NSString *pem1 = [pemStr componentsSeparatedByString:@"-----END RSA PRIVATE KEY-----"][0];
//NSLog(@"PEM String content1:\n%@", pem1);
NSString * pemResult = [pem1 componentsSeparatedByString:@"-----BEGIN RSA PRIVATE KEY-----\n"][1];
NSLog(@"PEM Private String result:\n%@", pemResult);

ENGINE_finish(rsaEngine);
RSA_free(rsaKey);

return pemResult; 

}
`

This is the PEM result:
-----BEGIN RSA PRIVATE KEY----- MIIDGQIBAAKCAQEAqWHQ7K7sVNWb4QZe2TFdDeOH3zwYVU8aGWkh9KmUSadpBLpW heg0jhAx9v9+67cN+yJxHM02SOQmghk3aFKG/u39tm3rxGLrlEMIirUTY9Z60oaM 9NOV9Q0Z5sSdNILfeMcZ01MrHlqJC/IjTPANPyhn3i2W4ZlgnmQLvvUvpUDwYexO B33e/DZf64OW7DOjh2qlNhTYxxo3fKJAA+C/dCL5IHL5TWYHrlULO7bVIisflUNj hyfEWcfRB8/XfN2+2NcBawp+OIbzPpik3mVNKuIYcf7JjVKgcJP7DYvzCGyoplTQ OrcekSIO6UhXqc4Dd8tn0lXRIPBV1ndvzYFe6wIDAQABAoIBACs5k5v67cOeeXec 7RKHJuSW9oMQ7nLCy3nFmw05Q2biaony1Ya5ocPJPT73p5eWsOIwQWZktiA23N7h eYLNYLbo3BC0j3Cf/9dnnePr3sVhJBnajVkjL8cH7161ORr/9PB4+s2zkTLfTs72 HW0Sa4b9FDieML1kq0PwaxDxuBV3CSrkxb0OJ9pXJGnJl5QIMmZgHXpXVOgvbPrL fr3yduTmmxVaPBcj+6WvdikvhIA01E1CV6nMzR2CW31ilWwLPZwZw51N7pRNqZuP Cx24KnktrXo7yCCGeO2xkVrnYG6XhWplzxH9DsNwGDZ7U1wqSinUTfvlyubwMdq4 sOy7lrkCgYEAyZnnC4tGxAeu7G+N+zxb8dOpHrk88VsXRoNH1sj54CIwj+y77amx 4J6WCw/y7A9L/K3Fpn3Cbje5MNQJlizDLg8NdKWfC2yntkZD8SVEbU1EshDj8tWh MZSkKp3P7KM1ht1b8Okban9QNSnx+2y7Emtd2x78zjAFJt66yJGSx/kCgYEA1xZN BiXqqgNuMNyw8YqS4ByN57XD00E9LH/HU54eL6sCkU6DM7Echpy2k5rIi6rs1/Hx jS9pOcepqV4LE+0Q0/rwjGz7xWtZy0pCN1+nxWcHtC+BriBr2UE2/4VYIIo+UYVT 3Vbyx8jyIWfJ/a4wiE083nGjf3OPvFP9ptZY/wM= -----END RSA PRIVATE KEY-----

It looks right if I check it with:

openssl asn1parse -in output.key -inform PEM

I get:

0:d=0 hl=4 l= 793 cons: SEQUENCE 4:d=1 hl=2 l= 1 prim: INTEGER :00 7:d=1 hl=4 l= 257 prim: INTEGER :A961D0ECAEEC54D59BE1065ED9315D0DE387DF3C18554F1A196921F4A99449A76904BA5685E8348E1031F6FF7EEBB70DFB22711CCD3648E426821937685286FEEDFDB66DEBC462EB9443088AB51363D67AD2868CF4D395F50D19E6C49D3482DF78C719D3532B1E5A890BF2234CF00D3F2867DE2D96E199609E640BBEF52FA540F061EC4E077DDEFC365FEB8396EC33A3876AA53614D8C71A377CA24003E0BF7422F92072F94D6607AE550B3BB6D5222B1F9543638727C459C7D107CFD77CDDBED8D7016B0A7E3886F33E98A4DE654D2AE21871FEC98D52A07093FB0D8BF3086CA8A654D03AB71E91220EE94857A9CE0377CB67D255D120F055D6776FCD815EEB 268:d=1 hl=2 l= 3 prim: INTEGER :010001 273:d=1 hl=4 l= 256 prim: INTEGER :2B39939BFAEDC39E79779CED128726E496F68310EE72C2CB79C59B0D394366E26A89F2D586B9A1C3C93D3EF7A79796B0E230416664B62036DCDEE17982CD60B6E8DC10B48F709FFFD7679DE3EBDEC5612419DA8D59232FC707EF5EB5391AFFF4F078FACDB39132DF4ECEF61D6D126B86FD14389E30BD64AB43F06B10F1B81577092AE4C5BD0E27DA572469C99794083266601D7A5754E82F6CFACB7EBDF276E4E69B155A3C1723FBA5AF76292F848034D44D4257A9CCCD1D825B7D62956C0B3D9C19C39D4DEE944DA99B8F0B1DB82A792DAD7A3BC8208678EDB1915AE7606E97856A65CF11FD0EC37018367B535C2A4A29D44DFBE5CAE6F031DAB8B0ECBB96B9 533:d=1 hl=3 l= 129 prim: INTEGER :C999E70B8B46C407AEEC6F8DFB3C5BF1D3A91EB93CF15B17468347D6C8F9E022308FECBBEDA9B1E09E960B0FF2EC0F4BFCADC5A67DC26E37B930D409962CC32E0F0D74A59F0B6CA7B64643F125446D4D44B210E3F2D5A13194A42A9DCFECA33586DD5BF0E91B6A7F503529F1FB6CBB126B5DDB1EFCCE300526DEBAC89192C7F9 665:d=1 hl=3 l= 129 prim: INTEGER :D7164D0625EAAA036E30DCB0F18A92E01C8DE7B5C3D3413D2C7FC7539E1E2FAB02914E8333B11C869CB6939AC88BAAECD7F1F18D2F6939C7A9A95E0B13ED10D3FAF08C6CFBC56B59CB4A42375FA7C56707B42F81AE206BD94136FF8558208A3E518553DD56F2C7C8F22167C9FDAE30884D3CDE71A37F738FBC53FDA6D658FF03
But if I check with:
openssl rsa -in output.key -inform PEM -check

The result gives the following error output:
unable to load Private Key 140197225162392:error:0D078079:asn1 encoding routines:ASN1_ITEM_EX_D2I:field missing:tasn_dec.c:487:Field=dmp1, Type=RSA 140197225162392:error:04093004:rsa routines:OLD_RSA_PRIV_DECODE:RSA lib:rsa_ameth.c:119: 140197225162392:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:tasn_dec.c:1197: 140197225162392:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:374:Type=X509_ALGOR 140197225162392:error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error:tasn_dec.c:697:Field=pkeyalg, Type=PKCS8_PRIV_KEY_INFO 140197225162392:error:0907B00D:PEM routines:PEM_READ_BIO_PRIVATEKEY:ASN1 lib:pem_pkey.c:141:

openssl was built without bitcode. You must rebuild it with bitcode enabled

I'm getting this warning:
URGENT: all bitcode will be dropped because [path to openssl class] was built without bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. Note: This will be an error in the future.

Can you please update the version to one that contains bitcode?

After pod update receiving "No such file or directory error"

Keep receiving the following error log after pod install:

-> Installing OpenSSL (1.0.201)
  > Copying OpenSSL from `/Users/ashotvardanian/Library/Caches/CocoaPods/Pods/Release/OpenSSL/1.0.201-4e990` to `Pods/OpenSSL`
 > Running prepare command
   $ /bin/bash -c ' 'set\ -e' 'VERSION\=\"1.0.2a\"' 'SDKVERSION\=\`xcrun\ --sdk\ iphoneos\ --show-sdk-version\ 2\>\ /dev/null\`' '' 'BASEPATH\=\"\$\{PWD\}\"'
   'CURRENTPATH\=\"/tmp/openssl\"' 'ARCHS\=\"i386\ x86_64\ armv7\ armv7s\ arm64\"' 'DEVELOPER\=\`xcode-select\ -print-path\`' '' 'mkdir\ -p\
   \"\$\{CURRENTPATH\}\"' 'mkdir\ -p\ \"\$\{CURRENTPATH\}/bin\"' '' 'cp\ \"file.tgz\"\ \"\$\{CURRENTPATH\}/file.tgz\"' 'cd\ \"\$\{CURRENTPATH\}\"' 'tar\ -xzf\
   file.tgz' 'cd\ \"openssl-\$\{VERSION\}\"' '' 'for\ ARCH\ in\ \$\{ARCHS\}' 'do' '\ \ CONFIGURE_FOR\=\"iphoneos-cross\"' '' '\ \ if\ \[\ \"\$\{ARCH\}\"\ \=\=\
   \"i386\"\ \]\ \|\|\ \[\ \"\$\{ARCH\}\"\ \=\=\ \"x86_64\"\ \]\ \;' '\ \ then' '\ \ \ \ PLATFORM\=\"iPhoneSimulator\"' '\ \ \ \ if\ \[\ \"\$\{ARCH\}\"\ \=\=\
   \"x86_64\"\ \]\ \;' '\ \ \ \ then' '\ \ \ \ \ \ CONFIGURE_FOR\=\"darwin64-x86_64-cc\"' '\ \ \ \ fi' '\ \ else' '\ \ \ \ sed\ -ie\ \"s\!static\ volatile\
   sig_atomic_t\ intr_signal\;\!static\ volatile\ intr_signal\;\!\"\ \"crypto/ui/ui_openssl.c\"' '\ \ \ \ PLATFORM\=\"iPhoneOS\"' '\ \ fi' '' '\ \ export\
   CROSS_TOP\=\"\$\{DEVELOPER\}/Platforms/\$\{PLATFORM\}.platform/Developer\"' '\ \ export\ CROSS_SDK\=\"\$\{PLATFORM\}\$\{SDKVERSION\}.sdk\"' '' '\ \ echo\
   \"Building\ openssl-\$\{VERSION\}\ for\ \$\{PLATFORM\}\ \$\{SDKVERSION\}\ \$\{ARCH\}\"' '\ \ echo\ \"Please\ stand\ by...\"' '' '\ \ export\
   CC\=\"\$\{DEVELOPER\}/usr/bin/gcc\ -arch\ \$\{ARCH\}\ -miphoneos-version-min\=\$\{SDKVERSION\}\"' '\ \ mkdir\ -p\
   \"\$\{CURRENTPATH\}/bin/\$\{PLATFORM\}\$\{SDKVERSION\}-\$\{ARCH\}.sdk\"' '\ \
   LOG\=\"\$\{CURRENTPATH\}/bin/\$\{PLATFORM\}\$\{SDKVERSION\}-\$\{ARCH\}.sdk/build-openssl-\$\{VERSION\}.log\"' '' '\ \ LIPO_LIBSSL\=\"\$\{LIPO_LIBSSL\}\
   \$\{CURRENTPATH\}/bin/\$\{PLATFORM\}\$\{SDKVERSION\}-\$\{ARCH\}.sdk/lib/libssl.a\"' '\ \ LIPO_LIBCRYPTO\=\"\$\{LIPO_LIBCRYPTO\}\
   \$\{CURRENTPATH\}/bin/\$\{PLATFORM\}\$\{SDKVERSION\}-\$\{ARCH\}.sdk/lib/libcrypto.a\"' '' '\ \ ./Configure\ \$\{CONFIGURE_FOR\}\
   --openssldir\=\"\$\{CURRENTPATH\}/bin/\$\{PLATFORM\}\$\{SDKVERSION\}-\$\{ARCH\}.sdk\"\ \>\ \"\$\{LOG\}\"\ 2\>\&1' '\ \ sed\ -ie\
   \"s\!\^CFLAG\=\!CFLAG\=-isysroot\ \$\{CROSS_TOP\}/SDKs/\$\{CROSS_SDK\}\ \!\"\ \"Makefile\"' '' '\ \ make\ \>\>\ \"\$\{LOG\}\"\ 2\>\&1' '\ \ make\ all\
   install_sw\ \>\>\ \"\$\{LOG\}\"\ 2\>\&1' '\ \ make\ clean\ \>\>\ \"\$\{LOG\}\"\ 2\>\&1' 'done' '' '' 'echo\ \"Build\ library...\"' 'rm\ -rf\
   \"\$\{BASEPATH\}/lib/\"' 'mkdir\ -p\ \"\$\{BASEPATH\}/lib/\"' 'lipo\ -create\ \$\{LIPO_LIBSSL\}\ \ \ \ -output\ \"\$\{BASEPATH\}/lib/libssl.a\"' 'lipo\
   -create\ \$\{LIPO_LIBCRYPTO\}\ -output\ \"\$\{BASEPATH\}/lib/libcrypto.a\"' '' 'echo\ \"Copying\ headers...\"' 'rm\ -rf\
   \"\$\{BASEPATH\}/opensslIncludes/\"' 'mkdir\ -p\ \"\$\{BASEPATH\}/opensslIncludes/\"' 'cp\ -RL\ \"\$\{CURRENTPATH\}/openssl-\$\{VERSION\}/include/openssl\"\
   \"\$\{BASEPATH\}/opensslIncludes/\"' '' 'cd\ \"\$\{BASEPATH\}\"' 'echo\ \"Building\ done.\"' '' 'echo\ \"Cleaning\ up...\"' 'rm\ -rf\ \"\$\{CURRENTPATH\}\"'
   'echo\ \"Done.\"
   cp: file.tgz: No such file or directory

[!] /bin/bash -c '
'set\ -e'
'VERSION\=\"1.0.2a\"'
'SDKVERSION\=\`xcrun\ --sdk\ iphoneos\ --show-sdk-version\ 2\>\ /dev/null\`'
''
'BASEPATH\=\"\$\{PWD\}\"'
'CURRENTPATH\=\"/tmp/openssl\"'
'ARCHS\=\"i386\ x86_64\ armv7\ armv7s\ arm64\"'
'DEVELOPER\=\`xcode-select\ -print-path\`'
''
'mkdir\ -p\ \"\$\{CURRENTPATH\}\"'
'mkdir\ -p\ \"\$\{CURRENTPATH\}/bin\"'
''
'cp\ \"file.tgz\"\ \"\$\{CURRENTPATH\}/file.tgz\"'
'cd\ \"\$\{CURRENTPATH\}\"'
'tar\ -xzf\ file.tgz'
'cd\ \"openssl-\$\{VERSION\}\"'
''
'for\ ARCH\ in\ \$\{ARCHS\}'
'do'
'\ \ CONFIGURE_FOR\=\"iphoneos-cross\"'
''
'\ \ if\ \[\ \"\$\{ARCH\}\"\ \=\=\ \"i386\"\ \]\ \|\|\ \[\ \"\$\{ARCH\}\"\ \=\=\ \"x86_64\"\ \]\ \;'
'\ \ then'
'\ \ \ \ PLATFORM\=\"iPhoneSimulator\"'
'\ \ \ \ if\ \[\ \"\$\{ARCH\}\"\ \=\=\ \"x86_64\"\ \]\ \;'
'\ \ \ \ then'
'\ \ \ \ \ \ CONFIGURE_FOR\=\"darwin64-x86_64-cc\"'
'\ \ \ \ fi'
'\ \ else'
'\ \ \ \ sed\ -ie\ \"s\!static\ volatile\ sig_atomic_t\ intr_signal\;\!static\ volatile\ intr_signal\;\!\"\ \"crypto/ui/ui_openssl.c\"'
'\ \ \ \ PLATFORM\=\"iPhoneOS\"'
'\ \ fi'
''
'\ \ export\ CROSS_TOP\=\"\$\{DEVELOPER\}/Platforms/\$\{PLATFORM\}.platform/Developer\"'
'\ \ export\ CROSS_SDK\=\"\$\{PLATFORM\}\$\{SDKVERSION\}.sdk\"'
''
'\ \ echo\ \"Building\ openssl-\$\{VERSION\}\ for\ \$\{PLATFORM\}\ \$\{SDKVERSION\}\ \$\{ARCH\}\"'
'\ \ echo\ \"Please\ stand\ by...\"'
''
'\ \ export\ CC\=\"\$\{DEVELOPER\}/usr/bin/gcc\ -arch\ \$\{ARCH\}\ -miphoneos-version-min\=\$\{SDKVERSION\}\"'
'\ \ mkdir\ -p\ \"\$\{CURRENTPATH\}/bin/\$\{PLATFORM\}\$\{SDKVERSION\}-\$\{ARCH\}.sdk\"'
'\ \ LOG\=\"\$\{CURRENTPATH\}/bin/\$\{PLATFORM\}\$\{SDKVERSION\}-\$\{ARCH\}.sdk/build-openssl-\$\{VERSION\}.log\"'
''
'\ \ LIPO_LIBSSL\=\"\$\{LIPO_LIBSSL\}\ \$\{CURRENTPATH\}/bin/\$\{PLATFORM\}\$\{SDKVERSION\}-\$\{ARCH\}.sdk/lib/libssl.a\"'
'\ \ LIPO_LIBCRYPTO\=\"\$\{LIPO_LIBCRYPTO\}\ \$\{CURRENTPATH\}/bin/\$\{PLATFORM\}\$\{SDKVERSION\}-\$\{ARCH\}.sdk/lib/libcrypto.a\"'
''
'\ \ ./Configure\ \$\{CONFIGURE_FOR\}\ --openssldir\=\"\$\{CURRENTPATH\}/bin/\$\{PLATFORM\}\$\{SDKVERSION\}-\$\{ARCH\}.sdk\"\ \>\ \"\$\{LOG\}\"\ 2\>\&1'
'\ \ sed\ -ie\ \"s\!\^CFLAG\=\!CFLAG\=-isysroot\ \$\{CROSS_TOP\}/SDKs/\$\{CROSS_SDK\}\ \!\"\ \"Makefile\"'
''
'\ \ make\ \>\>\ \"\$\{LOG\}\"\ 2\>\&1'
'\ \ make\ all\ install_sw\ \>\>\ \"\$\{LOG\}\"\ 2\>\&1'
'\ \ make\ clean\ \>\>\ \"\$\{LOG\}\"\ 2\>\&1'
'done'
''
''
'echo\ \"Build\ library...\"'
'rm\ -rf\ \"\$\{BASEPATH\}/lib/\"'
'mkdir\ -p\ \"\$\{BASEPATH\}/lib/\"'
'lipo\ -create\ \$\{LIPO_LIBSSL\}\ \ \ \ -output\ \"\$\{BASEPATH\}/lib/libssl.a\"'
'lipo\ -create\ \$\{LIPO_LIBCRYPTO\}\ -output\ \"\$\{BASEPATH\}/lib/libcrypto.a\"'
''
'echo\ \"Copying\ headers...\"'
'rm\ -rf\ \"\$\{BASEPATH\}/opensslIncludes/\"'
'mkdir\ -p\ \"\$\{BASEPATH\}/opensslIncludes/\"'
'cp\ -RL\ \"\$\{CURRENTPATH\}/openssl-\$\{VERSION\}/include/openssl\"\ \"\$\{BASEPATH\}/opensslIncludes/\"'
''
'cd\ \"\$\{BASEPATH\}\"'
'echo\ \"Building\ done.\"'
''
'echo\ \"Cleaning\ up...\"'
'rm\ -rf\ \"\$\{CURRENTPATH\}\"'
'echo\ \"Done.\"

cp: file.tgz: No such file or directory


/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/executable.rb:72:in `execute_command'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/executable.rb:27:in `block in executable'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/installer/pod_source_installer.rb:110:in `block (2 levels) in run_prepare_command'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/installer/pod_source_installer.rb:106:in `chdir'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/installer/pod_source_installer.rb:106:in `block in run_prepare_command'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/user_interface.rb:49:in `section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/installer/pod_source_installer.rb:105:in `run_prepare_command'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/installer/pod_source_installer.rb:46:in `install!'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/installer.rb:303:in `install_source_of_pod'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/installer.rb:278:in `block (2 levels) in install_pod_sources'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/user_interface.rb:70:in `titled_section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/installer.rb:277:in `block in install_pod_sources'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/installer.rb:269:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/installer.rb:269:in `install_pod_sources'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/installer.rb:121:in `block in download_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/user_interface.rb:49:in `section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/installer.rb:119:in `download_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/installer.rb:91:in `install!'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/command/project.rb:71:in `run_install_with_update'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/command/project.rb:101:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-0.8.1/lib/claide/command.rb:312:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/lib/cocoapods/command.rb:46:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.0.beta.1/bin/pod:44:in `<top (required)>'
/usr/bin/pod:23:in `load'
/usr/bin/pod:23:in `<main>'

What to do with that?

WatchOS 2 support

Hi!
Im trying to integrate this pod in my watchOS 2 target, but Im getting the following error:

ld: file is universal (5 slices) but does not contain a(n) armv7k slice: .../Pods/OpenSSL/lib/libssl.a file '.../Pods/OpenSSL/lib/libssl.a' for architecture armv7k

Do you support arch armv7k?

Thanks!

Header files broken in 1.0.108

Hi there. I'm very excited about an OpenSSL pod that isn't a binary blob. I think there's a bug in how the headers are installed though. Somewhere in the install process the actual headers are removed and you are left with dangling symlinks:

$ cd Pods/Headers/OpenSSL/openssl
$ ls -l md5.h
lrwxr-xr-x 1 tpot staff 38 27 Jun 17:27 md5.h -> ../../../OpenSSL/include/openssl/md5.h
$ ls -l ../../../OpenSSL/include/openssl/md5.h
lrwxr-xr-x 1 tpot staff 22 5 Jun 19:45 ../../../OpenSSL/include/openssl/md5.h -> ../../crypto/md5/md5.h
$ ls -l ../../crypto/md5/md5.h
ls: ../../crypto/md5/md5.h: No such file or directory

Unable to build Signal-iOS as OpenSSL moved download links

I would like to file an issue, because OpenSSL moved the LTS version 1.0.2 to a different download location with all the unsupported versions under:
https://www.openssl.org/source/old/

Latest Podspec
https://github.com/FredericJacobs/OpenSSL-Pod/blob/master/1.0.210/OpenSSL.podspec
has outdated URL to
https://openssl.org/source/openssl-1.0.2j.tar.gz
It should be
https://www.openssl.org/source/old/1.0.2/openssl-1.0.2j.tar.gz

The LTS version (supported until 31st December 2019) is available at
https://www.openssl.org/source/openssl-1.0.2l.tar.gz

Latest version of OpenSSL 1.1.0 is available at download link
https://www.openssl.org/source/openssl-1.1.0f.tar.gz

Please verify the issue, I'll try to create a PR if necessary.

Pod update takes forever

When doing pod update the process takes forever to compile OpenSSL. Is there any way of making this faster, perhaps using pre-compiled libraries?

Can't pod install on OS X 10.11 / Xcode 7

I've been trying to pod install a project that requires this (Signal-iOS), but it's consistently failing to build for me on my machine (OS X 10.11.4, Xcode 7). Relevant failure in the log:

/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch i386 -miphoneos-version-min=7.0 -I. -I.. -I../include  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk -fomit-frame-pointer -fno-common   -c -o mem_clr.o mem_clr.c
ar  r ../libcrypto.a cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o uid.o o_time.o o_str.o o_dir.o o_fips.o o_init.o fips_ers.o mem_clr.o
ar: ../libcrypto.a is a fat file (use libtool(1) or lipo(1) and ar(1) on it)
ar: ../libcrypto.a: Inappropriate file type or format
make[1]: *** [../libcrypto.a] Error 1
make: *** [build_crypto] Error 1

Steps to reproduce:

  1. git clone http://github.com/whispersystems/signal-ios
  2. pod install (or pod install --verbose, for more fun)

There are a couple GitHub Issues on the Signal-iOS repo that indicate this isn't just a "my machine is broken" problem, but it also pretty clearly seems like an OpenSSL issue rather than a Signal-iOS issue.

The way I've solved this in my own personal development environment is switching to the "OpenSSL-Universal" pod (which solves the problem by just including prebuilt binaries), but since it's a full minor point release behind your pod that's presumably not a viable option.

Googling around, this seems to be a relatively common issue (e.g. http://stackoverflow.com/questions/37063202/getting-libcrypto-ar-error-while-compiling-openssl-for-mac), the solution to which is usually to switch from ar to libtool. While I'm pretty confident I could kluge together some fix by manually modifying the Makefile on my machine, that doesn't really seem like a scalable solution, given that presumably most (or at least many) people trying to install this pod are going to run into that problem.

Not sure what the viable solution is – assuming the issue is in fact solved by updating the Makefile, and assuming OpenSSL isn't actually interested in making those changes upstream, maybe modifying the podspec install script to modify the Makefile itself? Just an addition to the README for this pod that outlines what needs to be done?

Happy to help in any way that I can, but I figured first would be to see if this is an issue you've encountered and/or solved before.

Thanks!

OpenSSL broken on iOS 8.1 and Swift (Xcode 6.1.1)

Hi,

Currently trying to get your pod to work in a Swift project.
Actually it installs through cocoapods, but when I try to include it, there are some Errors.

To reproduce:

  • Create ne Swift only Project
  • Use latest pod on cocoapods 0.3.6.rc.1
  • Include <openssl/aes.h> in bridging header

Looks like there are some headers missing.

Issue Installing OpenSSL (1.0.204.1)

Unable to install pod version 1.0.204.1

$ pod --version && pod repo update && pod install
0.39.0
Updating spec repo `master`
Already up-to-date.
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Installing OpenSSL (1.0.204.1)

[!] Error installing OpenSSL
[!] /usr/bin/curl -f -L -o /var/folders/lt/1zypd7251rbg9qdygfq2xx2w0000gn/T/d20151204-86704-ezv5l9/file.tgz https://openssl.org/source/openssl-1.0.2d.tar.gz --create-dirs

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (22) The requested URL returned error: 404 Not Found

Error installing OpenSSL (1.0.205)

Installing OpenSSL (1.0.205)

[!] Error installing OpenSSL
[!] /usr/bin/curl -f -L -o /var/folders/vl/q8v6pm857859gkyq1kxn1l09ffx3ct/T/d20160128-10254-12eil9y/file.tgz https://openssl.org/source/openssl-1.0.2e.tar.gz --create-dirs

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (22) The requested URL returned error: 404 Not Found

set the platforms in Cocoapods Spec

The spec id not pass validation when I exec pod spec lint:

- ERROR | [watchOS] Returned on unsuccessful exit code.
- NOTE  | [watchOS] [BEROR]error: There is no SDK with the name or path 'watchos'
- NOTE  | [watchOS] error: There is no SDK with the name or path 'watchos'

I found the spec have not platforms ! Please add below code in the spec:

"platform": {
    "ios": "7.0"
}

On the other hand, why did you set the min version 7.0 in the prepare_command?

MIN_SDK_VERSION_FLAG="-miphoneos-version-min=7.0"

Documentation?

Is there any documentation anywhere on how to use this?

Error installing OpenSSL (1.0.207)

[!] /usr/bin/curl -f -L -o /var/folders/jq/hwq41c4s1hs36fkdqrw_q0qm0000gn/T/d20160503-16029-fke6lu/file.tgz https://openssl.org/source/openssl-1.0.2g.tar.gz --create-dirs

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0curl: (22) The requested URL returned error: 404 Not Found

Similar to #28

Could you guys please update the pod? Thanks!

error: in auto-import: failed to get module from AST context:

Install seems to be working fine, but I can no longer view variables in the debugger:

(lldb) po self
warning: Swift error in module Spoiler Alert Food Safety.
Debug info from this module will be unavailable in the debugger.

error: in auto-import:
failed to get module 'Spoiler_Alert_Food_Safety' from AST context:
/Development/Spoiler-Alert-Food-Safety/Spoiler Alert Food Safety/Spoiler Alert Food Safety-Bridging-Header.h:8:9: note: in file included from /Development/Spoiler-Alert-Food-Safety/Spoiler Alert Food Safety/Spoiler Alert Food Safety-Bridging-Header.h:8:
#import <openssl/x509.h>
^

/Development/Spoiler-Alert-Food-Safety/Spoiler Alert Food Safety/Pods/Headers/Public/OpenSSL/openssl/x509.h:96:13: note: in file included from /Development/Spoiler-Alert-Food-Safety/Spoiler Alert Food Safety/Pods/Headers/Public/OpenSSL/openssl/x509.h:96:

include <openssl/rsa.h>

        ^

error: /Development/Spoiler-Alert-Food-Safety/Spoiler Alert Food Safety/Pods/Headers/Public/OpenSSL/openssl/rsa.h:96:51: error: expected ')'
int (*rsa_mod_exp) (BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx);
^

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk/usr/include/complex.h:42:11: note: expanded from macro 'I'
#define I _Complex_I
^

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk/usr/include/complex.h:40:21: note: expanded from macro '_Complex_I'
#define _Complex_I (extension 1.0iF)
^

/Development/Spoiler-Alert-Food-Safety/Spoiler Alert Food Safety/Pods/Headers/Public/OpenSSL/openssl/rsa.h:96:51: note: to match this '('
int (*rsa_mod_exp) (BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx);
^

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk/usr/include/complex.h:42:11: note: expanded from macro 'I'
#define I _Complex_I
^

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk/usr/include/complex.h:40:20: note: expanded from macro '_Complex_I'
#define _Complex_I (extension 1.0iF)
^

error: failed to import bridging header '/Development/Spoiler-Alert-Food-Safety/Spoiler Alert Food Safety/Spoiler Alert Food Safety-Bridging-Header.h'

Pod Lint warnings: [-Wdocumentation]

Running pod lib lint there are a few documentation warnings:
- WARN | xcodebuild: Headers/Public/OpenSSL/openssl/ecdsa.h:295:14: warning: parameter 'flags' not found in the function declaration [-Wdocumentation] - NOTE | xcodebuild: Headers/Public/OpenSSL/openssl/ecdsa.h:295:14: note: did you mean 'name'? - WARN | xcodebuild: Headers/Public/OpenSSL/openssl/ecdsa.h:301:14: warning: parameter 'ecdsa_method' not found in the function declaration [-Wdocumentation] - WARN | xcodebuild: Headers/Public/OpenSSL/openssl/ecdsa.h:302:14: warning: parameter 'name' not found in the function declaration [-Wdocumentation]

Unable to Install Pod

Fails with below error for

pod 'OpenSSL', '~> 1.0'

[!] /bin/bash -c set -e VERSION="1.0.2j" SDKVERSION=xcrun --sdk iphoneos --show-sdk-version 2> /dev/null`
MIN_SDK_VERSION_FLAG="-miphoneos-version-min=7.0"

BASEPATH="${PWD}"
CURRENTPATH="/tmp/openssl"
ARCHS="i386 x86_64 armv7 armv7s arm64"
DEVELOPER=xcode-select -print-path

mkdir -p "${CURRENTPATH}"
mkdir -p "${CURRENTPATH}/bin"

cp "file.tgz" "${CURRENTPATH}/file.tgz"
cd "${CURRENTPATH}"
tar -xzf file.tgz
cd "openssl-${VERSION}"

for ARCH in ${ARCHS}
do
CONFIGURE_FOR="iphoneos-cross"

if [ "${ARCH}" == "i386" ] || [ "${ARCH}" == "x86_64" ] ;
then
PLATFORM="iPhoneSimulator"
if [ "${ARCH}" == "x86_64" ] ;
then
CONFIGURE_FOR="darwin64-x86_64-cc"
fi
else
sed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" "crypto/ui/ui_openssl.c"
PLATFORM="iPhoneOS"
fi

export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
export CROSS_SDK="${PLATFORM}${SDKVERSION}.sdk"

echo "Building openssl-${VERSION} for ${PLATFORM} ${SDKVERSION} ${ARCH}"
echo "Please stand by..."

export CC="${DEVELOPER}/usr/bin/gcc -arch ${ARCH} ${MIN_SDK_VERSION_FLAG}"
mkdir -p "${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk"
LOG="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/build-openssl-${VERSION}.log"

LIPO_LIBSSL="${LIPO_LIBSSL} ${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/lib/libssl.a"
LIPO_LIBCRYPTO="${LIPO_LIBCRYPTO} ${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/lib/libcrypto.a"

./Configure ${CONFIGURE_FOR} --openssldir="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" > "${LOG}" 2>&1
sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} !" "Makefile"

make >> "${LOG}" 2>&1
make all install_sw >> "${LOG}" 2>&1
make clean >> "${LOG}" 2>&1
done

echo "Build library..."
rm -rf "${BASEPATH}/lib/"
mkdir -p "${BASEPATH}/lib/"
lipo -create ${LIPO_LIBSSL} -output "${BASEPATH}/lib/libssl.a"
lipo -create ${LIPO_LIBCRYPTO} -output "${BASEPATH}/lib/libcrypto.a"

echo "Copying headers..."
rm -rf "${BASEPATH}/opensslIncludes/"
mkdir -p "${BASEPATH}/opensslIncludes/"
cp -RL "${CURRENTPATH}/openssl-${VERSION}/include/openssl" "${BASEPATH}/opensslIncludes/"

cd "${BASEPATH}"
echo "Building done."

echo "Cleaning up..."
rm -rf "${CURRENTPATH}"
echo "Done."`

Problem installing OpenSSL 1.0.208

Hi guys!

I'm currently having some issues trying to install the OpenSSL pod. Oddly this error doesn't always happen, only in some PC's. Can someone shine a light on what may be causing this error?

Thanks!

[!] /bin/bash -c
set -e
VERSION="1.0.2h"
SDKVERSION=xcrun --sdk iphoneos --show-sdk-version 2> /dev/null
MIN_SDK_VERSION_FLAG="-miphoneos-version-min=7.0"

BASEPATH="${PWD}"
CURRENTPATH="/tmp/openssl"
ARCHS="i386 x86_64 armv7 armv7s arm64"
DEVELOPER=xcode-select -print-path

mkdir -p "${CURRENTPATH}"
mkdir -p "${CURRENTPATH}/bin"

cp "file.tgz" "${CURRENTPATH}/file.tgz"
cd "${CURRENTPATH}"
tar -xzf file.tgz
cd "openssl-${VERSION}"

for ARCH in ${ARCHS}
do
CONFIGURE_FOR="iphoneos-cross"

if [ "${ARCH}" == "i386" ] || [ "${ARCH}" == "x86_64" ] ;
then
PLATFORM="iPhoneSimulator"
if [ "${ARCH}" == "x86_64" ] ;
then
CONFIGURE_FOR="darwin64-x86_64-cc"
fi
else
sed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" "crypto/ui/ui_openssl.c"
PLATFORM="iPhoneOS"
fi

export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
export CROSS_SDK="${PLATFORM}${SDKVERSION}.sdk"

echo "Building openssl-${VERSION} for ${PLATFORM} ${SDKVERSION} ${ARCH}"
echo "Please stand by..."

export CC="${DEVELOPER}/usr/bin/gcc -arch ${ARCH} ${MIN_SDK_VERSION_FLAG}"
mkdir -p "${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk"
LOG="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/build-openssl-${VERSION}.log"

LIPO_LIBSSL="${LIPO_LIBSSL} ${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/lib/libssl.a"
LIPO_LIBCRYPTO="${LIPO_LIBCRYPTO} ${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/lib/libcrypto.a"

./Configure ${CONFIGURE_FOR} --openssldir="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" > "${LOG}" 2>&1
sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} !" "Makefile"

make >> "${LOG}" 2>&1
make all install_sw >> "${LOG}" 2>&1
make clean >> "${LOG}" 2>&1
done

echo "Build library..."
rm -rf "${BASEPATH}/lib/"
mkdir -p "${BASEPATH}/lib/"
lipo -create ${LIPO_LIBSSL} -output "${BASEPATH}/lib/libssl.a"
lipo -create ${LIPO_LIBCRYPTO} -output "${BASEPATH}/lib/libcrypto.a"

echo "Copying headers..."
rm -rf "${BASEPATH}/opensslIncludes/"
mkdir -p "${BASEPATH}/opensslIncludes/"
cp -RL "${CURRENTPATH}/openssl-${VERSION}/include/openssl" "${BASEPATH}/opensslIncludes/"

cd "${BASEPATH}"
echo "Building done."

echo "Cleaning up..."
rm -rf "${CURRENTPATH}"
echo "Done."

Building openssl-1.0.2h for iPhoneSimulator 9.2 i386
Please stand by…

Installing Openssl.... please stand by ..it's over.. I think install failed because my other framework has stop to install. How to fix it please...

Using Masonry (1.0.2)
Installing OpenSSL (1.0.210)
[!] /bin/bash -c
set -e
VERSION="1.0.2j"
SDKVERSION=xcrun --sdk iphoneos --show-sdk-version 2> /dev/null
MIN_SDK_VERSION_FLAG="-miphoneos-version-min=7.0"

BASEPATH="${PWD}"
CURRENTPATH="/tmp/openssl"
ARCHS="i386 x86_64 armv7 armv7s arm64"
DEVELOPER=xcode-select -print-path

mkdir -p "${CURRENTPATH}"
mkdir -p "${CURRENTPATH}/bin"

cp "file.tgz" "${CURRENTPATH}/file.tgz"
cd "${CURRENTPATH}"
tar -xzf file.tgz
cd "openssl-${VERSION}"

for ARCH in ${ARCHS}
do
CONFIGURE_FOR="iphoneos-cross"

if [ "${ARCH}" == "i386" ] || [ "${ARCH}" == "x86_64" ] ;
then
PLATFORM="iPhoneSimulator"
if [ "${ARCH}" == "x86_64" ] ;
then
CONFIGURE_FOR="darwin64-x86_64-cc"
fi
else
sed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" "crypto/ui/ui_openssl.c"
PLATFORM="iPhoneOS"
fi

export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
export CROSS_SDK="${PLATFORM}${SDKVERSION}.sdk"

echo "Building openssl-${VERSION} for ${PLATFORM} ${SDKVERSION} ${ARCH}"
echo "Please stand by..."

export CC="${DEVELOPER}/usr/bin/gcc -arch ${ARCH} ${MIN_SDK_VERSION_FLAG}"
mkdir -p "${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk"
LOG="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/build-openssl-${VERSION}.log"

LIPO_LIBSSL="${LIPO_LIBSSL} ${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/lib/libssl.a"
LIPO_LIBCRYPTO="${LIPO_LIBCRYPTO} ${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/lib/libcrypto.a"

./Configure ${CONFIGURE_FOR} --openssldir="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" > "${LOG}" 2>&1
sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} !" "Makefile"

make >> "${LOG}" 2>&1
make all install_sw >> "${LOG}" 2>&1
make clean >> "${LOG}" 2>&1
done

echo "Build library..."
rm -rf "${BASEPATH}/lib/"
mkdir -p "${BASEPATH}/lib/"
lipo -create ${LIPO_LIBSSL} -output "${BASEPATH}/lib/libssl.a"
lipo -create ${LIPO_LIBCRYPTO} -output "${BASEPATH}/lib/libcrypto.a"

echo "Copying headers..."
rm -rf "${BASEPATH}/opensslIncludes/"
mkdir -p "${BASEPATH}/opensslIncludes/"
cp -RL "${CURRENTPATH}/openssl-${VERSION}/include/openssl" "${BASEPATH}/opensslIncludes/"

cd "${BASEPATH}"
echo "Building done."

echo "Cleaning up..."
rm -rf "${CURRENTPATH}"
echo "Done."

Building openssl-1.0.2j for iPhoneSimulator 10.1 i386
Please stand by...

OpenSSL 1.0.2 tarball has disappeared

Installing OpenSSL (1.0.200)

[!] Error installing OpenSSL
[!] /usr/bin/curl -f -L -o /Users/distiller/lpm-mmd-ios/Pods/OpenSSL/file.tgz "https://www.openssl.org/source/openssl-1.0.2.tar.gz" --create-dirs

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed


  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0

curl: (22) The requested URL returned error: 404 Not Found

pod install returned exit code 1

Action failed: pod install

call “RC4_set_key”, crash

struct rc4_key_st key;
RC4_set_key(&key, 16, (const unsigned char *)"aaaaaaaaaaaaaaaaaaaaaaaaa");

crash!!!!!!!!!!!

OS X Support

On OS X 10.11 final

Create a new OS X Project, call it TestApplication
Quit Project
Create a podfile and add
target :TestApplication do
pod 'OpenSSL', '~> 1.0'
end

Use pod install and wait for result
Open the workspace and compile the TestApplication

Use
otool -L (binary in the app bundle)
It still shows the library being linked agains the way to old /usr/lib/libcrypto.0.9.8 and /usr/lib/libssl.0.9.8

otool -tV on libPods-TestApplication.a shows there is nothing in there, just an empty text segment

It seems badly broken now

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.