mozilla / tls-observatory

An observatory for TLS configurations, X509 certificates, and more.
Mozilla Public License 2.0
535 stars 88 forks source link

Wrong ECC keys length ? 512 to 521 #426

Open Guiforge opened 3 years ago

Guiforge commented 3 years ago

Description

File: https://github.com/mozilla/tls-observatory/blob/cf43108d68808f5db37116cb54b7b42341db4cab/worker/mozillaGradingWorker/keyexchangeGrading.go

//ECCRSAKeySize is used to translate ECC keys length to their corresponding RSA ones
var ECCRSAKeySize = map[float64]float64{
    160: 1024,
    224: 2048,
    256: 3072,
    384: 7680,
    512: 15360,
}

I'm not sure. I think that instead of value 512 it is necessary to put the value 521 It seems to me that the possible values are:

//ECCRSAKeySize is used to translate ECC keys length to their corresponding RSA ones
var ECCRSAKeySize = map[float64]float64{
    160: 1024,
    224: 2048,
    256: 3072,
    384: 7680,
    521: 15360,
}

Example:

massmailer.io image

getBitsForKeyExchange return probably -1

image

Ref:

In the curves file, there is no curve that is equal to 512: (https://github.com/mozilla/tls-observatory/blob/cf43108d68808f5db37116cb54b7b42341db4cab/constants/curves.go) image