Dr. Stephen Henson пишет:
On Fri, Mar 19, 2010, Valery Blazhnov wrote:

It seems to me that direct memory copying in crypto/evp/digest.c: EVP_MD_CTX_copy_ex() may conflct with internal engine implementation. IMHO it would be better to perform that direct memory copying only if there is no engine digest->copy method implemented:
       if (!out->digest->copy)
           memcpy(out->md_data,in->md_data,out->digest->ctx_size);


If that is changed it will break an ENGINE that relies on that behaviour. For
example it makes minor fixups after the copy.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

It seems to me that digest->copy() method implemented in engine exactly to avoid direct memory copying in OpenSSL itself. On the other hand if engine digest context includes pointers or some handles then direct memory copying may cause errors. IMHO EVP_MD_CTX_copy_ex() function should use memcpy() OR digest->copy() but not memcpy() AND digest->copy()..

Valery Blazhnov
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to