Encryption key length check refuses 24-byte keys and accepts 64-byte keys
I maintainer di solito rispondono entro 10 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 88/100
Direzione di ricerca
Il controllo della lunghezza si trova in x/acl_enc_keys.go dentro GetEncAclKeys, intorno alla riga 55, e le stesse tre lunghezze compaiono nel testo di aiuto di registerEncFlag e nel messaggio di errore. Inizia leggendo quel controllo e verifica che rifiuti le chiavi da 24 byte e accetti quelle da 64. È completato quando il controllo e il testo dell'errore accettano e indicano esattamente 16, 24 o 32 byte, con un test che verifichi che una chiave da 24 byte venga accettata e una da 64 byte venga rifiutata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
x.GetEncAclKeys (x/acl_enc_keys.go) accepts an --encryption key-file key of 16, 32 or 64 bytes and refuses
any other length. The --encryption help text (same file, registerEncFlag) and the documentation
(https://docs.dgraph.io/installation/configuration/encryption-at-rest: "The key size must be 16, 24, or 32 bytes")
say 16, 24 or 32. AES and Badger accept 16, 24 or 32. As a result:
- a 24-byte key (AES-192), which the help text and docs advertise, is refused at start;
- a 64-byte key passes the check, then the alpha exits when Badger opens its key registry.
Only 16- and 32-byte keys work. Both failures happen at start (they fail closed), so no data is at risk.
Versions
Seen on a build of v25.5.0 plus fork changes that do not touch this code. The same check is on main at
e95fc2652 (2026-11-20): x/acl_enc_keys.go line 55,
if l := len(encKey); encKey != nil && l != 16 && l != 32 && l != 64 {.
Steps to reproduce
head -c 24 /dev/urandom > key24
head -c 64 /dev/urandom > key64
dgraph zero --my=localhost:5080 &
dgraph alpha --my=localhost:7080 --zero=localhost:5080 --encryption "key-file=key24;"
# exits: encryption key must have length of 16, 32, or 64 bytes, got 24 bytes instead
dgraph alpha --my=localhost:7080 --zero=localhost:5080 --encryption "key-file=key64;"
# logs "Encryption feature enabled.", then exits:
# During OpenKeyRegistry err: Encryption key's length should beeither 16, 24, or 32 bytes
Expected
The check accepts exactly the lengths AES accepts and the help text and docs state: 16, 24 or 32 bytes.
Suggested fix
l != 16 && l != 24 && l != 32, and the same three lengths in the error message. The --vault path goes through
the same check, so it is fixed by the same line.
- Lingua principale
- Go
- Stelle
- 21.8k
- Fork
- 1.6k
- Merge medio
- 11g 7h
- PR unite (30g)
- 5
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di dgraph-io/dgraph
-
Broken links in the docsAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
I maintainer di solito rispondono entro 10 giorni
-
Stale
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
dgraph-io/dgraph#9811 · 1 commento ·
I maintainer di solito rispondono entro 10 giorni
-
Stale
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
dgraph-io/dgraph#9810 · 1 commento ·
I maintainer di solito rispondono entro 10 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 10 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
I maintainer di solito rispondono entro 10 giorni
Tutte le issue di dgraph-io/dgraph
Issue simili
-
【文档错误】创建镜像空间步骤中的截图标注与文字描述不一致Apertaenhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
DaoCloud/DaoCloud-docs#7839 ·
I maintainer di solito rispondono entro 1 giorno
-
Type: Enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
projectdiscovery/urlfinder#167 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
peterstace/simplefeatures#726 ·
-
area: import bug go good first issue priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
fukubie/StockLlama#69 ·
-
enhancement help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
cloverworks-hq/rumpty-cli#95 ·
I maintainer di solito rispondono entro 1 giorno