Make signing fail if a too small buffer is passed.

Bug discovered by Sergio Demian Lerner.