dnscrypt-wrapper icon indicating copy to clipboard operation
dnscrypt-wrapper copied to clipboard

SEGV when passing the same key twice

Open fische opened this issue 4 years ago • 0 comments

Hi!

While trying dnscrypt-wrapper, I've encountered a segmentation fault when passing the same secret key twice. Here are the steps to reproduce it:

dnscrypt-wrapper --gen-provider-keypair --provider-name=2.dnscrypt-cert.example.com --ext-address=127.0.0.1 --dnssec --nolog --nofilter
dnscrypt-wrapper --gen-crypt-keypair --crypt-secretkey-file=1.key
dnscrypt-wrapper --gen-cert-file --crypt-secretkey-file=1.key --provider-cert-file=1.cert --provider-publickey-file=public.key --provider-secretkey-file=secret.key
cp 1.key 2.key
cp 1.cert 2.cert

dnscrypt-wrapper --resolver-address=8.8.8.8:53 --listen-address=0.0.0.0:443 --provider-name=2.dnscrypt-cert.example.com --crypt-secretkey-file=1.key,2.key --provider-cert-file=1.cert,2.cert

The issue comes from match_cert_to_keys where cert_id is out of bound after matching the certificates with the first key.

fische avatar Apr 13 '20 13:04 fische