help-gnutls
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

segfault: setteing openpgp credentials via abstract functions


From: Joke de Buhr
Subject: segfault: setteing openpgp credentials via abstract functions
Date: Tue, 18 Sep 2012 17:23:32 +0200
User-agent: KMail/4.8.5 (Linux/3.5.1-1.fc17.x86_64; KDE/4.8.5; x86_64; ; )

hi,

i have discovered an problem regarding the openpgp functions.

if i try to set openpgp credentials by using the abstract functions gnutls 
segfaults.

gnutls_pcert_st pcert;
gnutls_privkey_t pkey;
gnutls_privkey_init(&pkey);
r = gnutls_pcert_import_openpgp_raw(&pcert, &pub_data,
        GNUTLS_OPENPGP_FMT_RAW, keyid, 0);
r = gnutls_privkey_import_openpgp_raw(pkey, &priv_data,
        GNUTLS_OPENPGP_FMT_RAW, keyid, nullptr);
r = gnutls_certificate_set_key(cre, nullptr, 1, &pcert, 1, pkey);

the last function will cause a segfault in cdk_kbnode_walk(). the keyid is 
specified correctly. the import functions return success. then pgp-key contains 
a master key and one single subkey.

#0 cdk_kbnode_walk() at lib/opencdk/kbnode.c:268
#1 _gnutls_openpgp_find_subkey_idx() at lib/openpgp/pgp.c:763
#2 gnutls_openpgp_privkey_get_subkey_idx() at lib/openpgp/privkey.c:583
#3 gnutls_openpgp_privkey_get_pk_algorithm() at lib/openpgp/privkey.c:269
#4 gnutls_openpgp_privkey_get_pk_algorithm() at lib/openpgp/privkey.c:251
#5 gnutls_privkey_get_pk_algorithm() at lib/gnutls_privkey.c:74
#6 _gnutls_check_key_cert_match() at lib/gnutls_cert.c:831
#7 gnutls_certificate_set_key() at lib/gnutls_x509.c:1102


regards
Joke

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]