The problem was that the rsa fips validation code did not allocate long enough buffers, so it was trashing the stack.