Make digest() in EntityCapsManager synchronized

Fixes SMACK-617
This commit is contained in:
Florian Schmaus 2014-11-14 21:02:18 +01:00
parent 4000adb70c
commit a848437284
1 changed files with 4 additions and 1 deletions

View File

@ -654,7 +654,10 @@ public class EntityCapsManager extends Manager {
// encoded using Base64 as specified in Section 4 of RFC 4648
// (note: the Base64 output MUST NOT include whitespace and MUST set
// padding bits to zero).
byte[] digest = md.digest(sb.toString().getBytes());
byte[] digest;
synchronized(md) {
digest = md.digest(sb.toString().getBytes());
}
return Base64.encodeBytes(digest);
}