This is off the top of my head, didn't check the sources to make sure, so
validity is 'mostly sure but not entirely'.

Quite a few bits 'n pieces in OpenSSL are 'template' based. (several crypto
methods, a lot of ASN.1 work, an object stack, ...) Think about templates
(wider scope than just the C++ flavor) and then consider how you would
implement a mechanism like that in 'C': yep, through preprocessor work.
That's what's going on (be reminded about the preprocessor ## operator at
this point: it can be used to 'construct' variable, function, etc. names
from multiple parts.)

If you grep the OpenSSL source tree you'll find several macros with names
like DECLARE_<something> and IMPLEMENT_<something>, etc. and those buggers
perform the 'magic' of generating implementations for functions either
declared directly or through generation by a DECLARE_...() macro in a header
file.
IIRC it's BLOCK_CIPHER_<something> macros you want to look for; should most
probably hang around in a header file in crypto/evp. Grep for the preproc
concatenation operator (##) if you're not getting results otherwise; that
grep should lead you to any macros which might generate functions like the
ones you mention.


Your linker problem is, to me, a hint that you may have simply missed to
include one or two of those evp .c files in your cmake build process; those
.c files will make sure the functions you are missing are indeed generated
through the preproc and those BLOCK_CIPHER_xyz macros (assuming I have the
'BLOCK_CIPHER' bit right, that is. Don't take my word for it; check the
header files in crypto/evp and possibly crypto/des for any '##' and
percolate up from there. No voodoo/dead chicken required as long as you
stick with the ## basic move. ;-)


On Tue, Jul 6, 2010 at 2:02 PM, Deckers, Rob <rob.deck...@oce.com> wrote:

>  Thanks,
>
> I am starting to understand the structure.
> I now made the same structure in my CMake files.
>
> 11 engines and the modules crypto and ssl.
>
> But the Crypto module has a linker problem.
>
>
> 1>------ Build started: Project: openssl.crypto, Configuration: Debug Win32
> ------
> 1>Linking...
> 1> Creating library
> Y:\solutions\si-refinfrablue\proglibs\OpenSSL\crypto\Debug\openssl.crypto.lib
> and object
> Y:\solutions\si-refinfrablue\proglibs\OpenSSL\crypto\Debug\openssl.crypto.exp
> 1>c_allc.obj : error LNK2019: unresolved external symbol _EVP_des_ecb
> referenced in function _OpenSSL_add_all_ciphers
> 1>c_allc.obj : error LNK2019: unresolved external symbol _EVP_des_cbc
> referenced in function _OpenSSL_add_all_ciphers
> 1>c_allc.obj : error LNK2019: unresolved external symbol _EVP_des_ofb
> referenced in function _OpenSSL_add_all_ciphers
> 1>c_allc.obj : error LNK2019: unresolved external symbol _EVP_des_cfb8
> referenced in function _OpenSSL_add_all_ciphers
> 1>c_allc.obj : error LNK2019: unresolved external symbol _EVP_des_cfb1
> referenced in function _OpenSSL_add_all_ciphers
> 1>c_allc.obj : error LNK2019: unresolved external symbol _EVP_des_cfb64
> referenced in function _OpenSSL_add_all_ciphers
> 1>e_old.obj : error LNK2001: unresolved external symbol _EVP_des_cfb64
> 1>Y:\solutions\si-refinfrablue\proglibs\OpenSSL\crypto\Debug\openssl.crypto.dll
> : fatal error LNK1120: 6 unresolved externals
> 1>Build log was saved at
> file://y:\solutions\si-refinfrablue\proglibs\OpenSSL\crypto\openssl.crypto.dir\Debug\BuildLog.htm
> 1>openssl.crypto - 8 error(s), 0 warning(s)
> ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
> When I search the code for "EVP_des_ecb", I find it in evp.h
> 00659: const EVP_CIPHER *EVP_des_ecb(void);
> 00660: const EVP_CIPHER *EVP_des_ede(void);
> 00661: const EVP_CIPHER *EVP_des_ede3(void);
> 00662: const EVP_CIPHER *EVP_des_ede_ecb(void);
> 00663: const EVP_CIPHER *EVP_des_ede3_ecb(void);
> 00664: const EVP_CIPHER *EVP_des_cfb64(void);
> and c_allc.c.
> 00092:  EVP_add_cipher(EVP_des_ecb());
> 00093:  EVP_add_cipher(EVP_des_ede());
> 00094:  EVP_add_cipher(EVP_des_ede3());
> But I can't find an implementation for these functions and the 'normal'
> OpenSSL build evironment doesn't seem to have problems with these functions.
>
>
> Rob Deckers
>
> This message and attachment(s) are intended solely for use by the addressee
> and may contain information that is privileged, confidential or otherwise
> exempt from disclosure under applicable law. If you are not the intended
> recipient or agent thereof responsible for delivering this message to the
> intended recipient, you are hereby notified that any dissemination,
> distribution or copying of this communication is strictly prohibited. If you
> have received this communication in error, please notify the sender
> immediately by telephone and with a 'reply' message. Thank you for your
> co-operation.
>



-- 
Met vriendelijke groeten / Best regards,

Ger Hobbelt

--------------------------------------------------
web:    http://www.hobbelt.com/
       http://www.hebbut.net/
mail:   g...@hobbelt.com
mobile: +31-6-11 120 978
--------------------------------------------------

Reply via email to