Reputation: 2597
I start develop iOS app using framework code I built myself from source code.
I added needed architectures to framework project and built framework, that add it to my application.
And when I tried to build application, Undefined symbols for architecture x86_64
errors was appeared, eg:
"_AES_ige_encrypt", referenced from: _MTAesEncryptInplace in MTProtoKit iOS (MTEncryption.o) _MTAesEncryptInplaceAndModifyIv in MTProtoKit iOS (MTEncryption.o) ... "_AES_set_encrypt_key", referenced from: _MTAesEncryptInplace in MTProtoKit iOS (MTEncryption.o) _MTAesEncryptInplaceAndModifyIv in MTProtoKit iOS (MTEncryption.o) ...
And many others, not only at MTEncryption
I looked framework source, file MTEncryption.m
:
void MTAesEncryptInplace(NSMutableData *data, NSData *key, NSData *iv)
{
AES_KEY aesKey;
AES_set_encrypt_key(key.bytes, 256, &aesKey); // <-- _AES_set_encrypt_key
unsigned char aesIv[AES_BLOCK_SIZE * 2];
memcpy(aesIv, iv.bytes, iv.length);
AES_ige_encrypt(data.bytes, (void *)data.bytes, data.length, &aesKey, aesIv, true); // <-- _AES_ige_encrypt
}
These methods are in .../openssl/aes.h
that is already included to build phases.
But I noticed that aes.m
file is missing (not just missing in build phases but file doesn't exist).
Is it normal? Or exactly .m
files missing is build failing reason? But if it's the reason, how framework was built successfully?
Upvotes: 1
Views: 616
Reputation: 2251
From scouting around the simulator files, i can't see a definitive iteration of aes or openssl which come "part and parcel".
On that note, you'd have to compile your own OpenSSL to support these missing libraries.
I did find a github repo for you that could be of help:
https://github.com/x2on/OpenSSL-for-iPhone
Hope this helps..
Upvotes: 1