| 162 ws_sha256_update(&ctx, salt, saltlen); |
162 ws_sha256_update(&ctx, salt, saltlen); |
| 163 ws_sha256_final(&ctx, pwhash); |
163 ws_sha256_final(&ctx, pwhash); |
| 164 break; |
164 break; |
| 165 } |
165 } |
| 166 case KEYFILE_SSHA512: { |
166 case KEYFILE_SSHA512: { |
| 167 SHA512_CTX ctx; |
167 WS_SHA512_CTX ctx; |
| 168 SHA512_Init(&ctx); |
168 ws_sha512_init(&ctx); |
| 169 SHA512_Update(&ctx, password, pwlen); |
169 ws_sha512_update(&ctx, password, pwlen); |
| 170 SHA512_Update(&ctx, salt, saltlen); |
170 ws_sha512_update(&ctx, salt, saltlen); |
| 171 SHA512_Final(pwhash, &ctx); |
171 ws_sha512_final(&ctx, pwhash); |
| 172 break; |
172 break; |
| 173 } |
173 } |
| 174 } |
174 } |
| 175 |
175 |
| 176 if(!memcmp(user->hash, pwhash, hlen)) { |
176 if(!memcmp(user->hash, pwhash, hlen)) { |