mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-07-27 12:24:14 +00:00
REALITY config: mldsa65Seed
and privateKey
can not be the same value
Otherwise the point of using ML-DSA-65 is lost.
This commit is contained in:
parent
10376f5b4d
commit
5f93ff6c3a
1 changed files with 3 additions and 0 deletions
|
@ -613,6 +613,9 @@ func (c *REALITYConfig) Build() (proto.Message, error) {
|
|||
config.MaxTimeDiff = c.MaxTimeDiff
|
||||
|
||||
if c.Mldsa65Seed != "" {
|
||||
if c.Mldsa65Seed == c.PrivateKey {
|
||||
return nil, errors.New(`"mldsa65Seed" and "privateKey" can not be the same value: `, c.Mldsa65Seed)
|
||||
}
|
||||
if config.Mldsa65Seed, err = base64.RawURLEncoding.DecodeString(c.Mldsa65Seed); err != nil || len(config.Mldsa65Seed) != 32 {
|
||||
return nil, errors.New(`invalid "mldsa65Seed": `, c.Mldsa65Seed)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue