Home GnuPG
Diffusion GnuPG 9832566e4512

agent: Add checkpin inquiry for pinentry


agent: Add checkpin inquiry for pinentry

* agent/call-pinentry.c: Include zb32.
(generate_pin): New.
(setup_genpin): New.
(inq_quality): Rename to ...
(inq_cb): this.  Handle checkpin inquiry.
(setup_enforced_constraints): New.
(agent_get_passphrase): Call sertup_genpin.  Call
setup_enforced_constraints if new passphrase is requested.

This implements the gpg-agent side for checking whether a new passphrase
entered by the user in pinentry satisfies the passphrase constraints.
Performing a checkpin inquiry is only allowed if the passphrase
constraints are enforced. setup_enforced_constraints sends necessary
options and translated strings to pinentry.

The patch also merges 557ddbde32585c534626b57a595a2ccf28fd585e et
al. from master to add the genpin inquiry machinery.

The suggested passphrase has the required entropy of 128 bits.