Fix some more tests, fix cert size check
This commit is contained in:
@ -107,7 +107,7 @@ func (key_certificate KeyCertificate) SigningPublicKeyType() (signing_pubkey_typ
|
|||||||
if len(key_certificate.SPKType.Bytes()) < 2 {
|
if len(key_certificate.SPKType.Bytes()) < 2 {
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
"at": "(KeyCertificate) SingingPublicKeyType",
|
"at": "(KeyCertificate) SingingPublicKeyType",
|
||||||
"data_len": len(*key_certificate.SPKType),
|
"data_len": len(key_certificate.SPKType.Bytes()),
|
||||||
"required_len": 2,
|
"required_len": 2,
|
||||||
"reason": "not enough data",
|
"reason": "not enough data",
|
||||||
}).Error("error retrieving Singning Public Key type")
|
}).Error("error retrieving Singning Public Key type")
|
||||||
@ -126,7 +126,7 @@ func (key_certificate KeyCertificate) PublicKeyType() (pubkey_type int, err erro
|
|||||||
if len(key_certificate.PKType.Bytes()) < 2 {
|
if len(key_certificate.PKType.Bytes()) < 2 {
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
"at": "(KeyCertificate) SingingPublicKeyType",
|
"at": "(KeyCertificate) SingingPublicKeyType",
|
||||||
"data_len": len(*key_certificate.PKType),
|
"data_len": len(key_certificate.PKType.Bytes()),
|
||||||
"required_len": 2,
|
"required_len": 2,
|
||||||
"reason": "not enough data",
|
"reason": "not enough data",
|
||||||
}).Error("error retrieving Singning Public Key type")
|
}).Error("error retrieving Singning Public Key type")
|
||||||
|
@ -138,7 +138,7 @@ func (keys_and_cert KeysAndCert) GetSigningPublicKey() (signing_public_key crypt
|
|||||||
//
|
//
|
||||||
func (keys_and_cert KeysAndCert) GetCertificate() (cert CertificateInterface, err error) {
|
func (keys_and_cert KeysAndCert) GetCertificate() (cert CertificateInterface, err error) {
|
||||||
data_len := len(keys_and_cert.Cert())
|
data_len := len(keys_and_cert.Cert())
|
||||||
if data_len < KEYS_AND_CERT_MIN_SIZE {
|
if data_len < CERT_MIN_SIZE {
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
"at": "ReadKeysAndCert",
|
"at": "ReadKeysAndCert",
|
||||||
"data_len": data_len,
|
"data_len": data_len,
|
||||||
@ -147,7 +147,7 @@ func (keys_and_cert KeysAndCert) GetCertificate() (cert CertificateInterface, er
|
|||||||
}).Error("error parsing keys and cert")
|
}).Error("error parsing keys and cert")
|
||||||
err = errors.New("certificate parsing warning: certificate data is shorter than specified by length")
|
err = errors.New("certificate parsing warning: certificate data is shorter than specified by length")
|
||||||
}
|
}
|
||||||
if data_len > KEYS_AND_CERT_MIN_SIZE {
|
if data_len > CERT_MIN_SIZE {
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
"at": "ReadKeysAndCert",
|
"at": "ReadKeysAndCert",
|
||||||
"data_len": data_len,
|
"data_len": data_len,
|
||||||
|
Reference in New Issue
Block a user