Changes to make use of code taken from libassuan. This replaces the