Hi everybody! Today I was investigating a problem that I have on my home pc since a few months.
The problem is that zypper repeatedly asks me to confirm repository signing keys even if I already told it to trust the key always.

I found a lot of threads with similar problems, which led me investigating zypper, gpg and rpm.At one point, I found out that my rpm db is corrupted, because when I enter 'rpm -qa gpg-pubkey*' this is what I get:

Code:
gpg-pubkey-accaf35c-57d58c01
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-6867f5be-4d77cecd
gpg-pubkey-ed340235-577f6c2e
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-0d988d6e-57839cae
gpg-pubkey-ed340235-577f6c2e
gpg-pubkey-1abd1afb-54176598
gpg-pubkey-c50a5d22-591463bb
gpg-pubkey-accaf35c-57d58c01
gpg-pubkey-f191f0e8-58bafb92
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-0d988d6e-57839cae
gpg-pubkey-0d988d6e-57839cae
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-8898875c-4c0241c4
gpg-pubkey-efb20b23-5a4f4f57
gpg-pubkey-0d988d6e-57839cae
gpg-pubkey-f191f0e8-58bafb92
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-11f63c51-3c7dc11d
gpg-pubkey-c50a5d22-591463bb
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-f191f0e8-58bafb92
gpg-pubkey-be1229cf-5631588c
gpg-pubkey-f191f0e8-58bafb92
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-0d988d6e-57839cae
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-c50a5d22-591463bb
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-f191f0e8-58bafb92
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-d38b4796-570c8cd3
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-ed340235-577f6c2e
gpg-pubkey-83a736cf-514c2089
gpg-pubkey-0d988d6e-57839cae
gpg-pubkey-0d988d6e-57839cae
gpg-pubkey-7fac5991-4615767f
gpg-pubkey-0d988d6e-57839cae
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-c3401e12-587def4d
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-7f8840ce-4bb222d5
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-ed340235-577f6c2e
gpg-pubkey-df7587c3-576a5c23
error: rpmdbNextIterator: skipping h#   64697 
Header V3 RSA/SHA256 Signature, key ID 3dbdc284: BAD
Header SHA1 digest: BAD (Expected bf167126ecaa67d16fee74af17096529278aad8d != cd4a91ad1f0d65d360cce5dacffea553e358b550)
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-f191f0e8-58bafb92
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-f191f0e8-58bafb92
gpg-pubkey-f191f0e8-58bafb92
gpg-pubkey-0d988d6e-57839cae
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-f191f0e8-58bafb92
gpg-pubkey-f191f0e8-58bafb92
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-ed340235-577f6c2e
gpg-pubkey-ed340235-577f6c2e
gpg-pubkey-ed340235-577f6c2e
gpg-pubkey-ed340235-577f6c2e
gpg-pubkey-3dbdc284-53674dd4
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-ed340235-577f6c2e
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-72db573c-4da468cb
gpg-pubkey-f4752699-57163f23
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-0d988d6e-57839cae
gpg-pubkey-0d988d6e-57839cae
gpg-pubkey-accaf35c-57d58c01
gpg-pubkey-efb20b23-5a4f4f57
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-d38b4796-570c8cd3
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-accaf35c-57d58c01
gpg-pubkey-0d988d6e-57839cae
gpg-pubkey-0c1289c0-58c6ad7d
gpg-pubkey-d4168679-59669fb3
gpg-pubkey-df7587c3-576a5c23
gpg-pubkey-ed340235-577f6c2e
gpg-pubkey-df7587c3-576a5c23
Besides the fact that there are a lot of duplicated entries (I don't know if it's normal), there is that ugly error that asks for immediate action.
So I took a backup of the rpm db and then issued 'sudo rpm -vv --rebuilddb', which gave me this (snipped):

Code:
(...)
Header SHA1 digest: OK
D: adding "bison" to Name index.
D: adding 53 entries to Basenames index.
D: adding "Development/Languages/C and C++" to Group index.
D: adding 17 entries to Requirename index.
D: adding 2 entries to Providename index.
D: adding 15 entries to Dirnames index.
D: adding 1 entries to Installtid index.
D: adding 1 entries to Sigmd5 index.
D: adding "71bc5f24969fabf4a56f13f92b3c9f7968f2fe1c" to Sha1header index.
D: adding 1 entries to Recommendname index.
D:  read h#   64697
Header SHA1 digest: BAD (Expected bf167126ecaa67d16fee74af17096529278aad8d != cd4a91ad1f0d65d360cce5dacffea553e358b550)
error: cannot add record originally at 64697
D: closed   db index       /usr/lib/sysimage/rpm/Packages
D: closed   db environment /usr/lib/sysimage/rpm
D: closed   db index       /usr/lib/sysimage/rpmrebuilddb.21797/Packages
D: closed   db index       /usr/lib/sysimage/rpmrebuilddb.21797/Enhancename
D: closed   db index       /usr/lib/sysimage/rpmrebuilddb.21797/Supplementname
D: closed   db index       /usr/lib/sysimage/rpmrebuilddb.21797/Suggestname
D: closed   db index       /usr/lib/sysimage/rpmrebuilddb.21797/Recommendname
D: closed   db index       /usr/lib/sysimage/rpmrebuilddb.21797/Transfiletriggername
D: closed   db index       /usr/lib/sysimage/rpmrebuilddb.21797/Filetriggername
D: closed   db index       /usr/lib/sysimage/rpmrebuilddb.21797/Sha1header
D: closed   db index       /usr/lib/sysimage/rpmrebuilddb.21797/Sigmd5
D: closed   db index       /usr/lib/sysimage/rpmrebuilddb.21797/Installtid
D: closed   db index       /usr/lib/sysimage/rpmrebuilddb.21797/Dirnames
D: closed   db index       /usr/lib/sysimage/rpmrebuilddb.21797/Triggername
D: closed   db index       /usr/lib/sysimage/rpmrebuilddb.21797/Obsoletename
D: closed   db index       /usr/lib/sysimage/rpmrebuilddb.21797/Conflictname
D: closed   db index       /usr/lib/sysimage/rpmrebuilddb.21797/Providename
D: closed   db index       /usr/lib/sysimage/rpmrebuilddb.21797/Requirename
D: closed   db index       /usr/lib/sysimage/rpmrebuilddb.21797/Group
D: closed   db index       /usr/lib/sysimage/rpmrebuilddb.21797/Basenames
D: closed   db index       /usr/lib/sysimage/rpmrebuilddb.21797/Name
D: closed   db environment /usr/lib/sysimage/rpmrebuilddb.21797
warning: failed to rebuild database: original database remains in place
So, I don't know if this is the root cause of my problems with zypper, but it is nevertheless something that has to be dealt with.
Given the fact that rpm itself hasn't been able to fix the situation, what possibilities do I have to fix the problem?

Thank you in advance.
Cris