----------------------------------------------------------------------------- Purpose: Compare two keys for equality Output: true if the keys are identical -----------------------------------------------------------------------------
| 352 | // Output: true if the keys are identical |
| 353 | //----------------------------------------------------------------------------- |
| 354 | bool CCryptoKeyBase::operator==( const CCryptoKeyBase &rhs ) const |
| 355 | { |
| 356 | if ( m_eKeyType != rhs.m_eKeyType ) return false; |
| 357 | uint32 cbRawData = GetRawData(nullptr); |
| 358 | if ( cbRawData != rhs.GetRawData(nullptr) ) return false; |
| 359 | |
| 360 | CAutoWipeBuffer bufLHS( cbRawData ); |
| 361 | CAutoWipeBuffer bufRHS( cbRawData ); |
| 362 | DbgVerify( GetRawData( bufLHS.Base() ) == cbRawData ); |
| 363 | DbgVerify( rhs.GetRawData( bufRHS.Base() ) == cbRawData ); |
| 364 | |
| 365 | return memcmp( bufLHS.Base(), bufRHS.Base(), cbRawData ) == 0; |
| 366 | } |
| 367 | |
| 368 | |
| 369 | //----------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected