MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / operator ==

Method operator ==

Libraries/unrar/secpassword.cpp:150–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148
149
150bool SecPassword::operator == (SecPassword &psw)
151{
152 // We cannot compare encoded data directly, because there is no guarantee
153 // than encryption function will always produce the same result for same
154 // data (salt?) and because we do not clean the rest of password buffer
155 // after trailing zero before encoding password. So we decode first.
156 wchar Plain1[MAXPASSWORD],Plain2[MAXPASSWORD];
157 Get(Plain1,ASIZE(Plain1));
158 psw.Get(Plain2,ASIZE(Plain2));
159 bool Result=wcscmp(Plain1,Plain2)==0;
160 cleandata(Plain1,ASIZE(Plain1));
161 cleandata(Plain2,ASIZE(Plain2));
162 return Result;
163}
164
165
166void SecHideData(void *Data,size_t DataSize,bool Encode,bool CrossProcess)

Callers

nothing calls this directly

Calls 2

cleandataFunction · 0.85
GetMethod · 0.80

Tested by

no test coverage detected