| 148 | |
| 149 | |
| 150 | bool 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 | |
| 166 | void SecHideData(void *Data,size_t DataSize,bool Encode,bool CrossProcess) |