Fixed padding management
Merge pull request #910 from hardening/hardening9

Fixed padding management when reading certificate