fix security code

I'm opening this PR on behalf of @macintux because there is a traffic jam of Yokozuna PRs that are all blocked on fixes for security code. At the same time I'm taking over review on this issue. After this issue #362 is next and then develop should once again work with the latest security code.