Allowing validation of padding bytes

For #602.  This takes the approach used for the TLS padding extension.