Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Autogenerated GPG key export failed if hostname was changed later #61

Open
albenik opened this Issue Oct 3, 2012 · 3 comments

Comments

Projects
None yet
3 participants

albenik commented Oct 3, 2012

This line just checked for gpg database files exists not for valid keys inside:
if [ -n "${BUILD_KEY}" ] || [ -e ${WORK_PATH}/gpg/pubring.gpg ] && [ -e ${WORK_PATH}/gpg/secring.gpg ] && [ -e ${WORK_PATH}/gpg/trustdb.gpg ]; then

But next command try to export keys related to hostname:
gpg --homedir ${WORK_PATH}/gpg --export -a "hostname --fqdn" > ${WORK_PATH}/deb/pubkey.asc

So no key exported if hostname was changed after initial keys generation

I encountered this issue and fixed it by regenerating the gpg key:
gpg --gen-key

albenik commented Nov 20, 2012

@tomcashman Thanks for the solution!
Of course I fixed this issue too, I just simle deleted autogenerated keys from ${WORK_PATH} and re-run a script
But the main idea of this issue is unclear behavior and log message in described situation

Maybe try to export first and if it fails then generate the key?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment