• Ilya Maykov's avatar
    fix self-assignment for OpenSSLHash::Digest, throw if context allocation... · 7b71f5e5
    Ilya Maykov authored
    fix self-assignment for OpenSSLHash::Digest, throw if context allocation fails, implement move support
    
    Summary:
    The copy assignment operator was not checking for self-assignment, which means the code was wrong when an object was being copied into itself.
    Also, allocation failure in the constructor would be silently ignored and result in a segfault crash later. Throw std::runtime_error if OpenSSL context allocation fails.
    Also, move constructor and move assignment operator were not implemented - they are now.
    
    Reviewed By: yfeldblum
    
    Differential Revision: D30879545
    
    fbshipit-source-id: 8b06f6fe97912a03ec5480a3b7c69aebf3a7f2ca
    7b71f5e5
OpenSSLHash.h 5.92 KB