Error importing key


#1

Dear daniele_athome,

i use ‘gpg --gen-key’ to create the key ,and run
gpg2 --export [fingerprint] >tigase-kontalk/server-public.key
gpg2 --export-secret-key [fingerprint] >tigase-kontalk/server-private.key
INSERT INTO servers (fingerprint, host, enabled) VALUES('[fingerprint]', '[service_name]', 1);

but log has error

12708 [kontalk:jabber:iq:register Queue Worker 2] INFO fm.last.commons.kyoto.factory.KyotoDbBuilder  - Creating Kyoto 'FILE_HASH' DB with descriptor '/home/hc/my/kontalk/tigase-kontalk/keyring.kch#bnum=100000#msiz=5242880' to open with modes '[READ_WRITE, CREATE]'
org.bouncycastle.openpgp.PGPException: error importing key
	at org.kontalk.xmppserver.pgp.GnuPGInterface.importKey(GnuPGInterface.java:82)
	at org.kontalk.xmppserver.KontalkKeyring.<init>(KontalkKeyring.java:58)

regards,

DeepChao


#2

Hi,
you need GnuPG at least version 2.1.14 for Kontalk. Please check your version.

If you already have that, please try to import them back manually using gpg:

gpg2 --import < tigase-kontalk/server-public.key

and check for any errors.


#3

Hi Daniele!

I’ve same error :
> [kontalk:jabber:iq:register Queue Worker 0] INFO fm.last.commons.kyoto.factory.KyotoDbBuilder - Creating Kyoto ‘FILE_HASH’ DB with descriptor ‘/home/termin/Downloads/tigase-kontalk/keyring.kch#bnum=100000#msiz=5242880’ to open with modes ‘[READ_WRITE, CREATE]’
> org.bouncycastle.openpgp.PGPException: error signing key
> at org.kontalk.xmppserver.pgp.GnuPGInterface.signKey(GnuPGInterface.java:119)
> at org.kontalk.xmppserver.KontalkKeyring.signKey(KontalkKeyring.java:143)
> at org.kontalk.xmppserver.KontalkIqRegister.signPublicKey(KontalkIqRegister.java:768)
> at org.kontalk.xmppserver.KontalkIqRegister.process(KontalkIqRegister.java:418)
> at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2562)
> at tigase.util.WorkerThread.run(WorkerThread.java:128)
> 2017-07-14 10:32:02.689 [kontalk:jabber:iq:register Queue Worker 0] KontalkIqRegister.process() WARNING: PGP problem: org.bouncycastle.openpgp.PGPException: error signing key

My gpg ver:
gpg (GnuPG) 2.1.18
libgcrypt 1.7.6-beta

Trying to import the key back using gpg2 --import < tigase-kontalk/server-public.key shows no errors:

gpg: key EA33D20B68FDD6E2: "Temur <te.ashurov@gmail.com>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1

I’m facing this while trying to varify a valid verification code (123456) with DummyProvider and android client log yelling:

07-14 10:55:07.501 26576-1914/org.kontalk.debug D/SMACK: SENT (5): <iq to='192.168.20.111' id='zmO07-11' type='set'><query xmlns='jabber:iq:register'><x xmlns='jabber:x:data' type='submit'><field var='FORM_TYPE' type='hidden'><value>http://kontalk.org/protocol/register#code</value></field><field label='Validation code' var='code' type='text-single'><value>123456</value></field></x></query></iq>
07-14 10:55:07.656 26576-1915/org.kontalk.debug D/SMACK: RECV (5): <iq id="zmO07-11" xmlns="jabber:client" from="192.168.20.111" type="error"><query xmlns="jabber:iq:register"><x xmlns="jabber:x:data" type="submit"><field type="hidden" var="FORM_TYPE"><value>http://kontalk.org/protocol/register#code</value></field><field type="text-single" var="code" label="Validation code"><value>123456</value></field></x></query><error code="400" type="modify"><bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" xml:lang="en">Invalid public key.</text></error></iq>

Your help is needed, what else could cause that behavior?


#4

(Discussion continued in Error while passing registration)