From n.mavrogiannopoulos at gmail.com Sun Jul 1 13:28:37 2018 From: n.mavrogiannopoulos at gmail.com (Nikos Mavrogiannopoulos) Date: Sun, 01 Jul 2018 13:28:37 +0200 Subject: [gnutls-help] gnutls-cli-debug "|<1>| Received record packet of unknown type 97" In-Reply-To: <452ae97bae1478aebae3c79345045d4c70dada6c.camel@aegee.org> References: <452ae97bae1478aebae3c79345045d4c70dada6c.camel@aegee.org> Message-ID: <75754b43c5f6836c999878c1fc17bae61844df00.camel@gmail.com> On Fri, 2018-06-22 at 21:33 +0000, ????? ???????? wrote: > Hello, > > 1) Why is printed "|<1>| Received record packet of unknown type 97" > below? > > $ gnutls-cli-debug -p 143 --starttls-proto imap mail.aegee.org > GnuTLS debug client 3.5.18 > Checking mail.aegee.org:143 > > <1>| Received record packet of unknown type 97 Most likely the server replies with an invalid message on cases which handshake fails. From Dilyan.Palauzov at aegee.org Sun Jul 1 18:56:24 2018 From: Dilyan.Palauzov at aegee.org (=?UTF-8?B?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?=) Date: Sun, 01 Jul 2018 18:56:24 +0200 Subject: [gnutls-help] gnutls-cli-debug "|<1>| Received record packet of unknown type 97" In-Reply-To: <75754b43c5f6836c999878c1fc17bae61844df00.camel@gmail.com> References: <452ae97bae1478aebae3c79345045d4c70dada6c.camel@aegee.org> <75754b43c5f6836c999878c1fc17bae61844df00.camel@gmail.com> Message-ID: Hello Nikos, this is one possible explanation. Another possible explanation is, that the server answers correctly,, but gnutls does not understand the reply. I don't know, that's why I asked here. Greetings ????? On July 1, 2018 1:28:37 PM GMT+02:00, Nikos Mavrogiannopoulos wrote: >On Fri, 2018-06-22 at 21:33 +0000, ????? ???????? wrote: >> Hello, >> >> 1) Why is printed "|<1>| Received record packet of unknown type 97" >> below? >> >> $ gnutls-cli-debug -p 143 --starttls-proto imap mail.aegee.org >> GnuTLS debug client 3.5.18 >> Checking mail.aegee.org:143 >> > <1>| Received record packet of unknown type 97 > >Most likely the server replies with an invalid message on cases which >handshake fails. > > > >_______________________________________________ >Gnutls-help mailing list >Gnutls-help at lists.gnutls.org >http://lists.gnupg.org/mailman/listinfo/gnutls-help From dilyan.palauzov at aegee.org Wed Jul 4 23:13:29 2018 From: dilyan.palauzov at aegee.org (=?UTF-8?Q?=D0=94=D0=B8=D0=BB=D1=8F=D0=BD_?= =?UTF-8?Q?=D0=9F=D0=B0=D0=BB=D0=B0=D1=83=D0=B7=D0=BE=D0=B2?=) Date: Wed, 04 Jul 2018 21:13:29 +0000 Subject: [gnutls-help] gnutls-cli-debug "|<1>| Received record packet of unknown type 97" / 2 In-Reply-To: References: <452ae97bae1478aebae3c79345045d4c70dada6c.camel@aegee.org> <75754b43c5f6836c999878c1fc17bae61844df00.camel@gmail.com> Message-ID: <5aa3e72959e1d6801798c00e079a8e7e14583d4e.camel@aegee.org> Hello, here some additional information. The server runs openssl 1.0.2o and calls SSL_CTX_set_options(context, SSL_OP_NO_TLSv1) but not SSL_CTX_set_cipher_list(context, "!TLSv1"); "openssl s_client -msg -connect mail.aegee.org:143 -tls1 -starttls imap" prints: CONNECTED(00000003) >>> ??? [length 0005] 16 03 01 00 c2 >>> TLS 1.0 Handshake [length 00c2], ClientHello 01 00 00 be 03 01 d5 75 8e 8a 53 8f f6 63 46 a9 bc 54 24 5b 18 3c 9d af 51 94 08 67 71 be 35 6d bd 48 ff 9a cd 25 00 00 64 c0 14 c0 0a 00 39 00 38 00 37 00 36 00 88 00 87 00 86 00 85 c0 0f c0 05 00 35 00 84 c0 13 c0 09 00 33 00 32 00 31 00 30 00 9a 00 99 00 98 00 97 00 45 00 44 00 43 00 42 c0 0e c0 04 00 2f 00 96 00 41 00 07 c0 11 c0 07 c0 0c c0 02 00 05 00 04 c0 12 c0 08 00 16 00 13 00 10 00 0d c0 0d c0 03 00 0a 00 ff 01 00 00 31 00 0b 00 04 03 00 01 02 00 0a 00 1c 00 1a 00 17 00 19 00 1c 00 1b 00 18 00 1a 00 16 00 0e 00 0d 00 0b 00 0c 00 09 00 0a 00 23 00 00 00 0f 00 01 01 <<< ??? [length 0005] 2e 20 4e 4f 20 >>> ??? [length 0005] 15 03 01 00 02 >>> TLS 1.0 Alert [length 0002], fatal protocol_version 02 46 --- no peer certificate available --- No client certificate CA names sent --- SSL handshake has read 834 bytes and written 7 bytes --- New, (NONE), Cipher is (NONE) Secure Renegotiation IS NOT supported No ALPN negotiated SSL-Session: Protocol : TLSv1 Cipher : 0000 Session-ID: Session-ID-ctx: Master-Key: Key-Arg : None PSK identity: None PSK identity hint: None SRP username: None Start Time: 1530738339 Timeout : 7200 (sec) Verify return code: 0 (ok) --- Alert 46 in HEX = 70 in Decimal = protocol_version(70) from enum AlertDescription (from RFC2246 = The TLS Protocol Version 1.0). The ciphers are "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH !aN ULL !eNULL !LOW -3DES !MD5 !EXP !PSK -SRP !DSS !RC4 !EDH" and the server sets the order. Regards ????? On Sun, 2018-07-01 at 18:56 +0200, ????? ???????? wrote: > Hello Nikos, > > this is one possible explanation. Another possible explanation is, > that the server answers correctly,, but gnutls does not understand > the reply. I don't know, that's why I asked here. > > Greetings > ????? > > On July 1, 2018 1:28:37 PM GMT+02:00, Nikos Mavrogiannopoulos ogiannopoulos at gmail.com> wrote: > > On Fri, 2018-06-22 at 21:33 +0000, ????? ???????? wrote: > > > Hello, > > > > > > 1) Why is printed "|<1>| Received record packet of unknown type > > > 97" > > > below? > > > > > > $ gnutls-cli-debug -p 143 --starttls-proto imap mail.aegee.org > > > GnuTLS debug client 3.5.18 > > > Checking mail.aegee.org:143 > > > > <1>| Received record packet of unknown type 97 > > > > Most likely the server replies with an invalid message on cases > > which > > handshake fails. > > > > > > > > _______________________________________________ > > Gnutls-help mailing list > > Gnutls-help at lists.gnutls.org > > http://lists.gnupg.org/mailman/listinfo/gnutls-help From dietmakarch at gmail.com Thu Jul 5 20:21:45 2018 From: dietmakarch at gmail.com (Markus Karch) Date: Thu, 5 Jul 2018 20:21:45 +0200 Subject: [gnutls-help] GnuTLS: Building of a certificate chain Message-ID: Hello everyone, I am trying to verify a certificate with the gnutls_x509_trust_list_verify_crt()-function [1]. I can pass a list of trusted CAs with the ?list?-parameter. My problem is that I also have a list of intermediate CAs which I do not trust but should be used to build the certificate chain. Something like the chain-parameter in the OpenSSL function X509_STORE_CTX_init . According to the documentation I can pass the certificate chain including the certificate which should be verified via the cert_list-parameter of the gnutls_x509_trust_list_verify_crt()-function . But is there a possibility to build that chain with a list of untrusted intermediate CAs? [1] https://www.gnutls.org/manual/gnutls.html#Verifying- X_002e509-certificate-paths Thank you very much ckmk14 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dietmakarch at gmail.com Fri Jul 6 12:37:44 2018 From: dietmakarch at gmail.com (Markus Karch) Date: Fri, 6 Jul 2018 12:37:44 +0200 Subject: [gnutls-help] Building a certificate chain Message-ID: Hello everyone, I have already sent a mail but I am not entirely sure if it works because of the registration process. Is it possible to build a certificate chain with gnutls? I am receiving only the end certificate and not the hole certificate chain. Instead I have a list of trusted CA certificates and a list of certificates which should be used to build the certificate chain. Is that possible? I was looking at the gnutls_x509_trust_list_verify_crt2()-function but I can only set the trusted certificates with the list-parameter and the end certificate with the cert_list-parameter. Regards, ckmk14 -------------- next part -------------- An HTML attachment was scrubbed... URL: From nmav at gnutls.org Sun Jul 8 19:50:03 2018 From: nmav at gnutls.org (Nikos Mavrogiannopoulos) Date: Sun, 08 Jul 2018 19:50:03 +0200 Subject: [gnutls-help] GnuTLS: Building of a certificate chain In-Reply-To: References: Message-ID: On Thu, 2018-07-05 at 20:21 +0200, Markus Karch wrote: > Hello everyone, > I am trying to verify a certificate with > the gnutls_x509_trust_list_verify_crt()-function [1]. I can pass a > list of trusted CAs with the ?list?-parameter. > My problem is that I also have a list of intermediate CAs which I do > not trust but should be used to build the certificate chain. > Something like the chain-parameter in the OpenSSL > function X509_STORE_CTX_init. According to the documentation I can > pass the certificate chain including the certificate which should be > verified via the cert_list-parameter of > the gnutls_x509_trust_list_verify_crt()-function . But is there a > possibility to build that chain with a list of untrusted intermediate > CAs? The gnutls_x509_trust_list_verify_crt() takes as cert_list the untrusted list. If the flag GNUTLS_VERIFY_DO_NOT_ALLOW_UNSORTED_CHAIN is not specified, then it will (re)create the chain/sort the list if it is not already sorted. You could then pass the end-certificate as first on the list and the untrusted intermediate CAs following it. That way the right list will be verified. Alternatively, if you'd like to "see" the sorted list, or if the list of untrusted intermediate CAs is large, you could insert them into a gnutls_x509_trust_list_t, and for the certificate you want you could use gnutls_x509_trust_list_get_issuer() recursively until you create the right list to provide to gnutls_x509_trust_list_verify_crt. regards, Nikos From nmav at gnutls.org Mon Jul 16 08:47:06 2018 From: nmav at gnutls.org (Nikos Mavrogiannopoulos) Date: Mon, 16 Jul 2018 08:47:06 +0200 Subject: [gnutls-help] gnutls 3.3.30 Message-ID: <641c9ddc8f5de4adf32ba181b241e7eaab44e27e.camel@gnutls.org> Hello, I've just released gnutls 3.3.30. This is a bug-fix release on the previous stable branch. * Version 3.3.30 (released 2018-07-16) ** libgnutls: Corrected infinite loop when an incorrect PIN was provided via pin-value or pin-source. ** gnutls-cli: backported the --sni-hostname option. This allows overriding the hostname advertised to the peer. ** Improved counter-measures for TLS CBC record padding. Kenny Paterson, Eyal Ronen and Adi Shamir reported that the existing countermeasures had certain issues and were insufficient when the attacker has additional access to the CPU cache and performs a chosen-plaintext attack. This affected the legacy CBC ciphersuites. [CVSS: medium] ** The ciphers utilizing HMAC-SHA384 and SHA256 have been removed from the default priority strings. They are not necessary for compatibility or other purpose and provide no advantage over their SHA1 counter-parts, as they all depend on the legacy TLS CBC block mode. ** API and ABI modifications: No changes since last version. Getting the Software ==================== GnuTLS may be downloaded directly from . A list of GnuTLS mirrors can be found at . Here are the XZ compressed sources: ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3/gnutls-3.3.30.tar.xz Here are OpenPGP detached signatures signed using key 0x96865171: ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3/gnutls-3.3.30.tar.xz.sig Note that it has been signed with my openpgp key: pub 3104R/96865171 2008-05-04 [expires: 2028-04-29] uid Nikos Mavrogiannopoulos gnutls.org> uid Nikos Mavrogiannopoulos gmail.com> sub 2048R/9013B842 2008-05-04 [expires: 2018-05-02] sub 2048R/1404A91D 2008-05-04 [expires: 2018-05-02] regards, Nikos From nmav at gnutls.org Mon Jul 16 08:48:19 2018 From: nmav at gnutls.org (Nikos Mavrogiannopoulos) Date: Mon, 16 Jul 2018 08:48:19 +0200 Subject: [gnutls-help] gnutls 3.5.19 Message-ID: <6168af54f22c58c45949fcac043d98b679fdc8cc.camel@gnutls.org> Hello, I've just released gnutls 3.5.19. This is a bug fix release on the current stable branch. * Version 3.5.19 (released 2018-07-16) ** libgnutls: Backported PKCS#11 module improvements in initialization from master branch. ** libgnutls: Corrected infinite loop when an incorrect PIN was provided via pin-value or pin-source. ** Improved counter-measures for TLS CBC record padding. Kenny Paterson, Eyal Ronen and Adi Shamir reported that the existing counter-measures had certain issues and were insufficient when the attacker has additional access to the CPU cache and performs a chosen-plaintext attack. This affected the legacy CBC ciphersuites. [CVSS: medium] ** The ciphers utilizing HMAC-SHA384 and SHA256 have been removed from the default priority strings. They are not necessary for compatibility or other purpose and provide no advantage over their SHA1 counter-parts, as they all depend on the legacy TLS CBC block mode. ** API and ABI modifications: No changes since last version. Getting the Software ==================== GnuTLS may be downloaded directly from . A list of GnuTLS mirrors can be found at . Here are the XZ compressed sources: https://www.gnupg.org/ftp/gcrypt/gnutls/v3.5/gnutls-3.5.19.tar.xz Here are OpenPGP detached signatures signed using key 0x96865171: https://www.gnupg.org/ftp/gcrypt/gnutls/v3.5/gnutls-3.5.19.tar.xz.sig Note that it has been signed with my openpgp key: pub 3104R/96865171 2008-05-04 [expires: 2028-04-29] uid Nikos Mavrogiannopoulos gnutls.org> uid Nikos Mavrogiannopoulos gmail.com> sub 2048R/9013B842 2008-05-04 [expires: 2018-05-02] sub 2048R/1404A91D 2008-05-04 [expires: 2018-05-02] regards, Nikos From nmav at gnutls.org Mon Jul 16 08:51:21 2018 From: nmav at gnutls.org (Nikos Mavrogiannopoulos) Date: Mon, 16 Jul 2018 08:51:21 +0200 Subject: [gnutls-help] gnutls 3.6.3 Message-ID: Hello, I've just released gnutls 3.6.3. This is the first release which adds full support of TLS1.3 (draft28), and several other features on the 3.6.x branch. * Version 3.6.3 (released 2018-07-16) ** libgnutls: Introduced support for draft-ietf-tls-tls13-28. It includes version negotiation, post handshake authentication, length hiding, multiple OCSP support, consistent ciphersuite support across protocols, hello retry requests, ability to adjust key shares via gnutls_init() flags, certificate authorities extension, and key usage limits. TLS1.3 draft-28 support can be enabled by default if the option --enable-tls13-support is given to configure script. ** libgnutls: Apply compatibility settings for existing applications running with TLS1.2 or earlier and TLS 1.3. When SRP or NULL ciphersuites are specified in priority strings TLS 1.3 is will be disabled. When Anonymous ciphersuites are specified in priority strings, then TLS 1.3 negotiation will be disabled if the session is associated only with an anonymous credentials structure. ** Added support for Russian Public Key Infrastructure according to RFCs 4491/4357/7836. This adds support for using GOST keys for digital signatures and under PKCS#7, PKCS#12, and PKCS#8 standards. In particular added elliptic curves GOST R 34.10-2001 CryptoProA 256-bit curve (RFC 4357), GOST R 34.10-2001 CryptoProXchA 256-bit curve (RFC 4357), and GOST R 34.10-2012 TC26-512-A 512-bit curve (RFC 7836). ** Provide a uniform cipher list across supported TLS protocols; the CAMELLIA ciphers as well as ciphers utilizing HMAC-SHA384 and SHA256 have been removed from the default priority strings, as they are undefined under TLS1.3 and they provide not advantage over other options in earlier protocols. ** The SSL 3.0 protocol is disabled on compile-time by default. It can be re-enabled by specifying --enable-ssl3-support on configure script. ** libgnutls: Introduced function to switch the current FIPS140-2 operational mode, i.e., strict vs a more lax mode which will allow certain non FIPS140-2 operations. ** libgnutls: Introduced low-level function to assist applications attempting client hello extension parsing, prior to GnuTLS' parsing of the message. ** libgnutls: When exporting an X.509 certificate avoid re-encoding if there are no modifications to the certificate. That prevents DER re-encoding issues with incorrectly encoded certificates, or other DER incompatibilities to affect a TLS session. Relates with #403 ** libgnutls: on group exchange honor the %SERVER_PRECEDENCE and select the groups which are preferred by the server. That unfortunately has complicated semantics as TLS1.2 requires specific ordering of the groups based on the ciphersuite ordering, which could make group order unpredictable if TLS1.3 is negotiated. ** Improved counter-measures for TLS CBC record padding. Kenny Paterson, Eyal Ronen and Adi Shamir reported that the existing counter-measures had certain issues and were insufficient when the attacker has additional access to the CPU cache and performs a chosen-plaintext attack. This affected the legacy CBC ciphersuites. [CVSS: medium] ** Introduced the %FORCE_ETM priority string option. This option prevents the negotiation of legacy CBC ciphersuites unless encrypt-then-mac is negotiated. ** libgnutls: gnutls_privkey_import_ext4() was enhanced with the GNUTLS_PRIVKEY_INFO_PK_ALGO_BITS flag. ** libgnutls: gnutls_pkcs11_copy_secret_key, gnutls_pkcs11_copy_x509_privkey2, gnutls_pkcs11_privkey_generate3 will mark objects as sensitive by default unless GNUTLS_PKCS11_OBJ_FLAG_MARK_NOT_SENSITIVE is specified. This is an API change for these functions which make them err towards safety. ** libgnutls: improved aarch64 cpu features detection by using getauxval(). ** certtool: It is now possible to specify certificate and serial CRL numbers greater than 2**63-2 as a hex-encoded string both when prompted and in a template file. Default certificate serial numbers are now fully random. Default CRL numbers include more random bits and are larger than in previous GnuTLS versions. Since CRL numbers are required to be monotonic, specify suitable CRL numbers manually if you intend to later downgrade to previous versions as it was not possible to specify large CRL numbers in previous versions of certtool. ** API and ABI modifications: gnutls_fips140_set_mode: Added gnutls_session_key_update: Added gnutls_ext_get_current_msg: Added gnutls_reauth: Added gnutls_ocsp_status_request_get2: Added gnutls_ocsp_resp_import2: Added gnutls_ocsp_resp_export2: Added gnutls_ocsp_resp_list_import2: Added gnutls_certificate_set_retrieve_function3: Added gnutls_certificate_set_ocsp_status_request_file2: Added gnutls_certificate_set_ocsp_status_request_mem: Added gnutls_certificate_get_ocsp_expiration: Added gnutls_record_send2: Added gnutls_ext_raw_parse: Added gnutls_x509_crt_list_import_url: Added gnutls_pcert_list_import_x509_file: Added gnutls_pkcs11_token_get_ptr: Added gnutls_pkcs11_obj_get_ptr: Added gnutls_session_ticket_send: Added gnutls_aead_cipher_encryptv: Added gnutls_gost_paramset_get_name: Added gnutls_gost_paramset_get_oid: Added gnutls_oid_to_gost_paramset: Added gnutls_decode_gost_rs_value: Added gnutls_encode_gost_rs_value: Added gnutls_pubkey_export_gost_raw2: Added gnutls_pubkey_import_gost_raw: Added gnutls_x509_crt_get_pk_gost_raw: Added gnutls_privkey_export_gost_raw2: Added gnutls_privkey_import_gost_raw: Added gnutls_x509_privkey_export_gost_raw: Added gnutls_x509_privkey_import_gost_raw: Added gnutls_set_default_priority_append: Added gnutls_priority_init2: Added GNUTLS_PRIVKEY_INFO_PK_ALGO_BITS: Added GNUTLS_PKCS11_OBJ_FLAG_MARK_NOT_SENSITIVE: Added Getting the Software ==================== GnuTLS may be downloaded directly from . A list of GnuTLS mirrors can be found at . Here are the XZ compressed sources: https://www.gnupg.org/ftp/gcrypt/gnutls/v3.6/gnutls-3.6.3.tar.xz Here are OpenPGP detached signatures signed using key 0x96865171: https://www.gnupg.org/ftp/gcrypt/gnutls/v3.6/gnutls-3.6.3.tar.xz.sig Note that it has been signed with my openpgp key: pub 3104R/96865171 2008-05-04 [expires: 2028-04-29] uid Nikos Mavrogiannopoulos gnutls.org> uid Nikos Mavrogiannopoulos gmail.com> sub 2048R/9013B842 2008-05-04 [expires: 2018-05-02] sub 2048R/1404A91D 2008-05-04 [expires: 2018-05-02] regards, Nikos From ludo at gnu.org Mon Jul 16 14:27:28 2018 From: ludo at gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Date: Mon, 16 Jul 2018 14:27:28 +0200 Subject: [gnutls-help] The development list is now read-only In-Reply-To: (Nikos Mavrogiannopoulos's message of "Sun, 15 Jul 2018 19:57:15 +0200") References: Message-ID: <87in5fwekv.fsf@gnu.org> Hello, Nikos Mavrogiannopoulos skribis: > As most of the work-flow for gnutls has switched to gitlab.com/gnutls > there is little purpose in keeping a separate forum for development > discussions. As such this mailing list is now read-only and will > receive the traffic from gitlab.com gnutls project as well as release > announcements. We encourage you to follow the project on > https://gitlab.com/gnutls/gnutls . > > If you wish to continue using a mailing list for questions or other > discussions please use the help-gnutls mailing list at: > https://lists.gnutls.org/mailman/listinfo/gnutls-help Gitlab.com?s ToS contain fairly obnoxious terms. In particular, Section 15 uses broad wording that I?m uncomfortable with: 15. Indemnification You agree to indemnify and hold harmless GitLab, its affiliates, [?] from and against any and all claims and expenses, including attorneys? fees [?] I wouldn?t want my savings to go to GitLab?s attorneys should someone attack them for something vaguely related to GnuTLS. IMO, contributing to free software should not require people to blindly accept such conditions. For that reason, I think it?s good to keep additional options for users to contribute. Ludo?. From dietmakarch at gmail.com Mon Jul 16 15:06:32 2018 From: dietmakarch at gmail.com (Markus Karch) Date: Mon, 16 Jul 2018 15:06:32 +0200 Subject: [gnutls-help] Setting Subject Key Identifier and Authority Key Identifier Message-ID: Hello, I am creating a self signed X.509 certificate and trying to set the SKI and the AKI. These values should be the SHA-1 of the public key. But when I am settign these values I am only getting the SHA-1 hash value of the private key. What am I doing wrong? Here is a code snippet : gnutls_x509_crt_t crt; gnutls_x509_privkey_t privKey; gnutls_x509_crt_init(&crt); gnutls_x509_privkey_init(&privKey); int gnuErr = gnutls_x509_privkey_generate(privKey, GNUTLS_PK_RSA, 2048, 0); gnuErr = gnutls_x509_crt_set_dn (crt, "O=test,CN=test", NULL); gnuErr = gnutls_x509_crt_set_key(crt, privKey); gnutls_x509_crt_set_version(crt, 3); int serialNumber = rand(); gnuErr = gnutls_x509_crt_set_serial(crt, &serialNumber, sizeof(int)); //Here is the problem gnutls_pubkey_t pubKey; gnuErr = gnutls_pubkey_init(&pubKey); gnuErr = gnutls_pubkey_import_x509(pubKey, crt,0 ); unsigned char test[20]; // Normally 20 bytes (SHA1) size_t size = sizeof(test); //Here I am getting the hash of the private key gnuErr = gnutls_pubkey_get_key_id(pubKey, 0, test, &size); gnuErr = gnutls_x509_crt_set_subject_key_id(crt, test, size); //.... Regards, ckmk14 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dietmakarch at gmail.com Mon Jul 16 15:45:54 2018 From: dietmakarch at gmail.com (Markus Karch) Date: Mon, 16 Jul 2018 15:45:54 +0200 Subject: [gnutls-help] Setting Subject Key Identifier and Authority Key Identifier In-Reply-To: References: Message-ID: Hello everyone, I have another example which make things a little bit more clear: In the code below am setting the SKI with the hash value of the private key (as supposed) using the gnutls_pubkey_import_x509-function. Then I am setting the AKI with the hash value of the private key (this is wrong but useful for test purposes). Unfortunately both values are the same. Why is it that way? gnutls_x509_crt_t crt; gnutls_x509_privkey_t privKey; gnutls_x509_crt_init(&crt); gnutls_x509_privkey_init(&privKey); int gnuErr = gnutls_x509_privkey_generate(privKey, GNUTLS_PK_RSA, 2048, 0); gnuErr = gnutls_x509_crt_set_dn (crt, "O=test,CN=test", NULL); gnuErr = gnutls_x509_crt_set_key(crt, privKey); gnutls_x509_crt_set_version(crt, 3); int serialNumber = rand(); gnuErr = gnutls_x509_crt_set_serial(crt, &serialNumber, sizeof(int)); //Here is the problem gnutls_pubkey_t pubKey; gnuErr = gnutls_pubkey_init(&pubKey); gnuErr = gnutls_pubkey_import_x509(pubKey, crt,0 ); unsigned char test[20]; size_t size = sizeof(test); gnuErr = gnutls_pubkey_get_key_id(pubKey, 0, test, &size); gnuErr = gnutls_x509_crt_set_subject_key_id(crt, test, size); gnutls_privkey_t priv; gnutls_privkey_init(&priv); gnutls_privkey_import_x509(priv, privKey, 0); unsigned char test2[20]; // Normally 20 bytes (SHA1) size_t size2 = sizeof(test2); gnutls_x509_privkey_get_key_id(privKey, 0, test2, &size2); gnuErr = gnutls_x509_crt_set_authority_key_id(crt, test2, size2); ///////////////////////////////////////////////////////////////// gnuErr = gnutls_x509_crt_set_key_usage(crt, GNUTLS_KEY_DIGITAL_SIGNATURE | GNUTLS_KEY_CRL_SIGN | GNUTLS_KEY_KEY_CERT_SIGN); gnuErr = gnutls_x509_crt_set_activation_time(crt, time(NULL)); gnuErr = gnutls_x509_crt_set_expiration_time(crt, time(NULL) + (60 * 60 * 24 * 365 * 10)); gnuErr = gnutls_x509_crt_sign2(crt, crt, privKey, GNUTLS_DIG_SHA256, 0); Regards, ckmk14 2018-07-16 15:06 GMT+02:00 Markus Karch : > Hello, > > I am creating a self signed X.509 certificate and trying to set the SKI > and the AKI. > These values should be the SHA-1 of the public key. > But when I am settign these values I am only getting the SHA-1 hash value > of the private key. > What am I doing wrong? Here is a code snippet : > > > > gnutls_x509_crt_t crt; > gnutls_x509_privkey_t privKey; > > gnutls_x509_crt_init(&crt); > gnutls_x509_privkey_init(&privKey); > > int gnuErr = gnutls_x509_privkey_generate(privKey, GNUTLS_PK_RSA, 2048, 0); > gnuErr = gnutls_x509_crt_set_dn (crt, "O=test,CN=test", NULL); > gnuErr = gnutls_x509_crt_set_key(crt, privKey); > gnutls_x509_crt_set_version(crt, 3); > int serialNumber = rand(); > gnuErr = gnutls_x509_crt_set_serial(crt, &serialNumber, sizeof(int)); > > //Here is the problem > gnutls_pubkey_t pubKey; > gnuErr = gnutls_pubkey_init(&pubKey); > gnuErr = gnutls_pubkey_import_x509(pubKey, crt,0 ); > unsigned char test[20]; // Normally 20 bytes (SHA1) > size_t size = sizeof(test); > //Here I am getting the hash of the private key > gnuErr = gnutls_pubkey_get_key_id(pubKey, 0, test, &size); > gnuErr = gnutls_x509_crt_set_subject_key_id(crt, test, size); > > //.... > > Regards, > ckmk14 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dietmakarch at gmail.com Mon Jul 16 20:08:37 2018 From: dietmakarch at gmail.com (Markus Karch) Date: Mon, 16 Jul 2018 20:08:37 +0200 Subject: [gnutls-help] Setting Subject Key Identifier and Authority Key Identifier In-Reply-To: References: Message-ID: Hello everyone, sorry for the multiple mails but I think I found my issue. In the documentation I discovered this: "Note that gnutls_pubkey_get_key_id calculates a SHA1 digest of the public key as a DER-formatted, subjectPublicKeyInfo object. Other implementations use different approaches, e.g., some use the ?common method? described in section 4.2.1.2 of [RFC5280 ] which calculates a digest on a part of the subjectPublicKeyInfo object. " Is it with gnutls possible to generate the key id with one of the "common methods" described in RFC5280? Regards, ckmk14 2018-07-16 15:06 GMT+02:00 Markus Karch : > Hello, > > I am creating a self signed X.509 certificate and trying to set the SKI > and the AKI. > These values should be the SHA-1 of the public key. > But when I am settign these values I am only getting the SHA-1 hash value > of the private key. > What am I doing wrong? Here is a code snippet : > > > > gnutls_x509_crt_t crt; > gnutls_x509_privkey_t privKey; > > gnutls_x509_crt_init(&crt); > gnutls_x509_privkey_init(&privKey); > > int gnuErr = gnutls_x509_privkey_generate(privKey, GNUTLS_PK_RSA, 2048, 0); > gnuErr = gnutls_x509_crt_set_dn (crt, "O=test,CN=test", NULL); > gnuErr = gnutls_x509_crt_set_key(crt, privKey); > gnutls_x509_crt_set_version(crt, 3); > int serialNumber = rand(); > gnuErr = gnutls_x509_crt_set_serial(crt, &serialNumber, sizeof(int)); > > //Here is the problem > gnutls_pubkey_t pubKey; > gnuErr = gnutls_pubkey_init(&pubKey); > gnuErr = gnutls_pubkey_import_x509(pubKey, crt,0 ); > unsigned char test[20]; // Normally 20 bytes (SHA1) > size_t size = sizeof(test); > //Here I am getting the hash of the private key > gnuErr = gnutls_pubkey_get_key_id(pubKey, 0, test, &size); > gnuErr = gnutls_x509_crt_set_subject_key_id(crt, test, size); > > //.... > > Regards, > ckmk14 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fgunbin at fastmail.fm Tue Jul 17 03:17:03 2018 From: fgunbin at fastmail.fm (Filipp Gunbin) Date: Tue, 17 Jul 2018 04:17:03 +0300 Subject: [gnutls-help] [gnutls-devel] gnutls 3.6.3 In-Reply-To: (Nikos Mavrogiannopoulos's message of "Mon, 16 Jul 2018 08:51:21 +0200") References: Message-ID: I've got this error when compiling 3.6.3 on macOS. Blindly changing strdupa -> strdup helped. CC tlsproxy/tlsproxy.o tlsproxy/tlsproxy.c:70:16: warning: implicit declaration of function 'strdupa' is invalid in C99 [-Wimplicit-function-declaration] char *addr = strdupa (addrport); ^ tlsproxy/tlsproxy.c:70:16: warning: this function declaration is not a prototype [-Wstrict-prototypes] tlsproxy/tlsproxy.c:70:9: warning: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' [-Wint-conversion] char *addr = strdupa (addrport); ^ ~~~~~~~~~~~~~~~~~~ tlsproxy/tlsproxy.c:72:9: warning: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] char *port = defaultport; ^ ~~~~~~~~~~~ tlsproxy/tlsproxy.c:137:16: warning: implicit declaration of function 'strdupa' is invalid in C99 [-Wimplicit-function-declaration] char *addr = strdupa (addrport); ^ tlsproxy/tlsproxy.c:137:9: warning: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' [-Wint-conversion] char *addr = strdupa (addrport); ^ ~~~~~~~~~~~~~~~~~~ tlsproxy/tlsproxy.c:139:9: warning: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] char *port = defaultport; ^ ~~~~~~~~~~~ tlsproxy/tlsproxy.c:327:11: warning: declaration shadows a variable in the global scope [-Wshadow] int optind = 0; ^ /usr/include/getopt.h:78:12: note: previous declaration is here extern int optind, opterr, optopt; ^ 8 warnings generated. CCLD tlsproxy/tlsproxy libtool: warning: '-no-install' is ignored for x86_64-apple-darwin17.6.0 libtool: warning: assuming '-no-fast-install' instead ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking. Undefined symbols for architecture x86_64: "_strdupa", referenced from: _runlistener in tlsproxy.o _runproxy in tlsproxy.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) From nmav at gnutls.org Tue Jul 17 13:53:39 2018 From: nmav at gnutls.org (Nikos Mavrogiannopoulos) Date: Tue, 17 Jul 2018 13:53:39 +0200 Subject: [gnutls-help] [gnutls-devel] gnutls 3.6.3 In-Reply-To: References: Message-ID: Thanks. You can ignore the failure as it is on an example application. On Tue, Jul 17, 2018 at 3:17 AM Filipp Gunbin wrote: > I've got this error when compiling 3.6.3 on macOS. Blindly changing > strdupa -> strdup helped. > > CC tlsproxy/tlsproxy.o > tlsproxy/tlsproxy.c:70:16: warning: implicit declaration of function > 'strdupa' is invalid in C99 [-Wimplicit-function-declaration] > char *addr = strdupa (addrport); > ^ > tlsproxy/tlsproxy.c:70:16: warning: this function declaration is not a > prototype [-Wstrict-prototypes] > tlsproxy/tlsproxy.c:70:9: warning: incompatible integer to pointer > conversion initializing 'char *' with an expression of type 'int' > [-Wint-conversion] > char *addr = strdupa (addrport); > ^ ~~~~~~~~~~~~~~~~~~ > tlsproxy/tlsproxy.c:72:9: warning: initializing 'char *' with an > expression of type 'const char *' discards qualifiers > [-Wincompatible-pointer-types-discards-qualifiers] > char *port = defaultport; > ^ ~~~~~~~~~~~ > tlsproxy/tlsproxy.c:137:16: warning: implicit declaration of function > 'strdupa' is invalid in C99 [-Wimplicit-function-declaration] > char *addr = strdupa (addrport); > ^ > tlsproxy/tlsproxy.c:137:9: warning: incompatible integer to pointer > conversion initializing 'char *' with an expression of type 'int' > [-Wint-conversion] > char *addr = strdupa (addrport); > ^ ~~~~~~~~~~~~~~~~~~ > tlsproxy/tlsproxy.c:139:9: warning: initializing 'char *' with an > expression of type 'const char *' discards qualifiers > [-Wincompatible-pointer-types-discards-qualifiers] > char *port = defaultport; > ^ ~~~~~~~~~~~ > tlsproxy/tlsproxy.c:327:11: warning: declaration shadows a variable in the > global scope [-Wshadow] > int optind = 0; > ^ > /usr/include/getopt.h:78:12: note: previous declaration is here > extern int optind, opterr, optopt; > ^ > 8 warnings generated. > CCLD tlsproxy/tlsproxy > libtool: warning: '-no-install' is ignored for x86_64-apple-darwin17.6.0 > libtool: warning: assuming '-no-fast-install' instead > ld: warning: text-based stub file > /System/Library/Frameworks//Security.framework/Security.tbd and library > file /System/Library/Frameworks//Security.framework/Security are out of > sync. Falling back to library file for linking. > Undefined symbols for architecture x86_64: > "_strdupa", referenced from: > _runlistener in tlsproxy.o > _runproxy in tlsproxy.o > ld: symbol(s) not found for architecture x86_64 > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.mavrogiannopoulos at gmail.com Wed Jul 18 07:51:25 2018 From: n.mavrogiannopoulos at gmail.com (Nikos Mavrogiannopoulos) Date: Wed, 18 Jul 2018 07:51:25 +0200 Subject: [gnutls-help] Setting Subject Key Identifier and Authority Key Identifier In-Reply-To: References: Message-ID: <8fd05316a68b25f649edff92ab498ee847d8e845.camel@gmail.com> On Mon, 2018-07-16 at 20:08 +0200, Markus Karch wrote: > Hello everyone, > > sorry for the multiple mails but I think I found my issue. In the > documentation I discovered this: > > "Note that gnutls_pubkey_get_key_id calculates a SHA1 digest of the > public key as a DER-formatted, subjectPublicKeyInfo object. Other > implementations use different approaches, e.g., some use the ?common > method? described in section 4.2.1.2 of [RFC5280] which calculates a > digest on a part of the subjectPublicKeyInfo object. " > > Is it with gnutls possible to generate the key id with one of the > "common methods" described in RFC5280? The functions to calculate the digest are helper ones. You can calculate that digest of the key any way you like including the rfc5280 methods. All you need is to access the public key (e.g., via gnutls_pubkey_t abstraction, and then the raw DER data). regards, Nikos From n.mavrogiannopoulos at gmail.com Wed Jul 18 07:54:15 2018 From: n.mavrogiannopoulos at gmail.com (Nikos Mavrogiannopoulos) Date: Wed, 18 Jul 2018 07:54:15 +0200 Subject: [gnutls-help] The development list is now read-only In-Reply-To: <87in5fwekv.fsf@gnu.org> References: <87in5fwekv.fsf@gnu.org> Message-ID: <92c3fcde18e13c1cb836aa7a4fa5ebae35c04fd7.camel@gmail.com> On Mon, 2018-07-16 at 14:27 +0200, Ludovic Court?s wrote: > Hello, > > Nikos Mavrogiannopoulos skribis: > > > As most of the work-flow for gnutls has switched to > > gitlab.com/gnutls > > there is little purpose in keeping a separate forum for development > > discussions. As such this mailing list is now read-only and will > > receive the traffic from gitlab.com gnutls project as well as > > release > > announcements. We encourage you to follow the project on > > https://gitlab.com/gnutls/gnutls . > > > > If you wish to continue using a mailing list for questions or other > > discussions please use the help-gnutls mailing list at: > > https://lists.gnutls.org/mailman/listinfo/gnutls-help > > Gitlab.com?s ToS contain fairly obnoxious terms. In particular, > Section > 15 uses broad wording that I?m uncomfortable with: > > 15. Indemnification > > You agree to indemnify and hold harmless GitLab, its affiliates, > [?] > from and against any and all claims and expenses, including > attorneys? > fees [?] > > I wouldn?t want my savings to go to GitLab?s attorneys should someone > attack them for something vaguely related to GnuTLS. I am not a lawyer and I cannot offer any advice on that. It does not look unreasonable to me however, that gitlab wouldn't want to take the blame for something the gnutls project may be sued for. regards, Nikos From ludo at gnu.org Thu Jul 19 14:39:22 2018 From: ludo at gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Date: Thu, 19 Jul 2018 14:39:22 +0200 Subject: [gnutls-help] The development list is now read-only In-Reply-To: <92c3fcde18e13c1cb836aa7a4fa5ebae35c04fd7.camel@gmail.com> (Nikos Mavrogiannopoulos's message of "Wed, 18 Jul 2018 07:54:15 +0200") References: <87in5fwekv.fsf@gnu.org> <92c3fcde18e13c1cb836aa7a4fa5ebae35c04fd7.camel@gmail.com> Message-ID: <871sbztn5x.fsf@gnu.org> Hi Nikos, Nikos Mavrogiannopoulos skribis: > On Mon, 2018-07-16 at 14:27 +0200, Ludovic Court?s wrote: [...] >> Gitlab.com?s ToS contain fairly obnoxious terms. In particular, >> Section >> 15 uses broad wording that I?m uncomfortable with: >> >> 15. Indemnification >> >> You agree to indemnify and hold harmless GitLab, its affiliates, >> [?] >> from and against any and all claims and expenses, including >> attorneys? >> fees [?] >> >> I wouldn?t want my savings to go to GitLab?s attorneys should someone >> attack them for something vaguely related to GnuTLS. > > I am not a lawyer and I cannot offer any advice on that. It does not > look unreasonable to me however, that gitlab wouldn't want to take the > blame for something the gnutls project may be sued for. People could sue them based on incorrect allegations about GnuTLS, and you would personally pay for their attorneys. This is hopefully an unlikely scenario, but it?s one GitLab protects itself against, so each one of us might want to protect themself against it as well. What bothers me (but it?s a problem that goes beyond GnuTLS, of course) is that I would end up signing a contract with a company I don?t want to deal with, possibly taking risks, when all I want is to contribute my time to a free software project I care about. I?m happy to engage in a ?moral contract? with contributors to the project. I?m not interested in having to sign a contract with a company that has nothing to do with the project. Free software started as work done by the people for the people. We used to rely a lot on non-profits to host our services (the FSF, Gna!, Tux Family, and so on) and the mission of these non-profits is/was precisely to support our free development efforts. We built the commons. Now that companies with different interests are in charge of some of our critical infrastructure, free software development seems to be more vulnerable: hosting sites close, companies are bought, ToS change, we have a distributed VCS but everything else is centralized, etc. I don?t have a good solution but since you already have the services in place, I?d suggest keeping the mailing list accessible and making it clear that patches are also accepted through that medium. Thoughts? Thanks for listening. :-) Ludo?. PS: I wasn?t planning to join this discussion since I haven?t really contributed to GnuTLS in recent years, but I was reminded of this situation when gitlab.com rejected a ?git push? from me in another project unless I signed their new ToS. From rogerdpack2 at gmail.com Fri Jul 20 16:07:25 2018 From: rogerdpack2 at gmail.com (Roger Pack) Date: Fri, 20 Jul 2018 08:07:25 -0600 Subject: [gnutls-help] some deps missing from gnutls.pc? Message-ID: As a note, for windows (cross compiling) I have to manually add -lcrypt32 to gnutls.pc and in OS X I have to add -framework Security Also in OS X: $ ./configure --with-included-libtasn1 --prefix=$(pwd)/installed --without-p11-kit && make -j2 ... Making all in guile Making all in src /Library/Developer/CommandLineTools/usr/bin/make all-am make[4]: Nothing to be done for `all-am'. GUILEC modules/gnutls.go Backtrace: In ice-9/boot-9.scm: 705:2 19 (call-with-prompt _ _ #) In ice-9/eval.scm: 619:8 18 (_ #(#(#))) In /usr/local/bin/guild: 72:17 17 (main _) In srfi/srfi-1.scm: 640:9 16 (for-each # ?) In scripts/compile.scm: 251:26 15 (_ _) In system/base/target.scm: 57:6 14 (with-target _ _) In system/base/compile.scm: 152:6 13 (compile-file _ #:output-file _ #:from _ #:to _ #:env _ ?) 43:4 12 (call-once _) In ice-9/boot-9.scm: 841:4 11 (with-throw-handler _ _ _) In system/base/compile.scm: 59:11 10 (_) 155:11 9 (_ #) 235:18 8 (read-and-compile # #:from _ #:to ?) 183:32 7 (compile-fold (#) ?) In ice-9/boot-9.scm: 2312:4 6 (save-module-excursion #) In language/scheme/compile-tree-il.scm: 31:15 5 (_) In ice-9/psyntax.scm: 1235:36 4 (expand-top-sequence ((eval-when (expand load eval) ?)) ?) 1182:24 3 (parse _ (("placeholder" placeholder)) ((top) #(# # ?)) ?) 285:10 2 (parse _ (("placeholder" placeholder)) ((top) #(# # ?)) ?) In unknown file: 1 (load-extension "/Users/rdp/dev/random/gnutls-3.5.19/g?" ?) In ice-9/boot-9.scm: 752:25 0 (dispatch-exception _ _ _) ice-9/boot-9.scm:752:25: In procedure dispatch-exception: In procedure dynamic-link: file: "/Users/rdp/dev/random/gnutls-3.5.19/guile/src/guile-gnutls-v-2", message: "file not found" make[3]: *** [modules/gnutls.go] Error 1 make[2]: *** [all-recursive] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From nmav at gnutls.org Tue Jul 24 21:53:07 2018 From: nmav at gnutls.org (Nikos Mavrogiannopoulos) Date: Tue, 24 Jul 2018 21:53:07 +0200 Subject: [gnutls-help] some deps missing from gnutls.pc? In-Reply-To: References: Message-ID: On Fri, Jul 20, 2018 at 4:07 PM, Roger Pack wrote: > As a note, for windows (cross compiling) I have to manually add > > -lcrypt32 > to gnutls.pc> > > and in OS X > > I have to add > > -framework Security Hi, In https://gitlab.com/gnutls/gnutls/pipelines/26381946 there are two mingw builds which compile just fine with the current setup. Also in travis there is a macosx build of gnutls which also succeeds: https://travis-ci.org/gnutls/gnutls Which version of gnutls do you try to cross compile? > Also in OS X: > $ ./configure --with-included-libtasn1 --prefix=$(pwd)/installed > --without-p11-kit && make -j2 [...] > > 640:9 16 (for-each # ?) > > In scripts/compile.scm: > > 251:26 15 (_ _) > > In system/base/target.scm: > > 57:6 14 (with-target _ _) > > In system/base/compile.scm: > > 152:6 13 (compile-file _ #:output-file _ #:from _ #:to _ #:env _ ?) > > 43:4 12 (call-once _) > > In ice-9/boot-9.scm: > > 841:4 11 (with-throw-handler _ _ _) > > In system/base/compile.scm: > > 59:11 10 (_) > > 155:11 9 (_ #) > > 235:18 8 (read-and-compile # #:from _ #:to ?) > > 183:32 7 (compile-fold (#) ?) > > In ice-9/boot-9.scm: > > 2312:4 6 (save-module-excursion #) > > In language/scheme/compile-tree-il.scm: > > 31:15 5 (_) > > In ice-9/psyntax.scm: > > 1235:36 4 (expand-top-sequence ((eval-when (expand load eval) ?)) ?) > > 1182:24 3 (parse _ (("placeholder" placeholder)) ((top) #(# # ?)) ?) > > 285:10 2 (parse _ (("placeholder" placeholder)) ((top) #(# # ?)) ?) > > In unknown file: > > 1 (load-extension "/Users/rdp/dev/random/gnutls-3.5.19/g?" ?) > > In ice-9/boot-9.scm: > > 752:25 0 (dispatch-exception _ _ _) > > > ice-9/boot-9.scm:752:25: In procedure dispatch-exception: > > In procedure dynamic-link: file: > "/Users/rdp/dev/random/gnutls-3.5.19/guile/src/guile-gnutls-v-2", message: > "file not found" > Does not ring a bell. You can disable guile bindings if you don't need them. regards, Nikos