* Version 3.6.6 (unreleased)
+** libgnutls: gnutls_pubkey_import_ecc_raw() was fixed to set the number bits
+ on the public key (#640).
+
** libgnutls: Added support for raw public-key authentication as defined in RFC7250.
Raw public-keys can be negotiated by enabling the corresponding certificate
types via the priority strings. The raw public-key mechanism must be explicitly
gnutls_datum_t p, q, g, y, x;
gnutls_datum_t m, e;
gnutls_ecc_curve_t curve;
+ unsigned bits;
int ret;
global_init();
if (ret < 0)
fail("error\n");
+ bits = 0;
+ ret = gnutls_pubkey_get_pk_algorithm(key, &bits);
+ if (ret <= 0 || bits == 0)
+ fail("error: %s [%u]\n", gnutls_strerror(ret), bits);
+
ret = gnutls_pubkey_export_dsa_raw2(key, &p, &q, &g, &y, 0);
if (ret < 0)
fail("error: %s\n", gnutls_strerror(ret));
if (ret < 0)
fail("error\n");
+ bits = 0;
+ ret = gnutls_pubkey_get_pk_algorithm(key, &bits);
+ if (ret <= 0 || bits == 0)
+ fail("error: %s [%u]\n", gnutls_strerror(ret), bits);
+
ret = gnutls_pubkey_export_rsa_raw2(key, &m, &e, 0);
if (ret < 0)
fail("error\n");
if (ret < 0)
fail("error\n");
+ bits = 0;
+ ret = gnutls_pubkey_get_pk_algorithm(key, &bits);
+ if (ret <= 0 || bits == 0)
+ fail("error: %s [%u]\n", gnutls_strerror(ret), bits);
+
ret = gnutls_pubkey_export_ecc_raw2(key, &curve, &x, &y, 0);
if (ret < 0)
fail("error\n");
if (ret < 0)
fail("error\n");
+ bits = 0;
+ ret = gnutls_pubkey_get_pk_algorithm(key, &bits);
+ if (ret <= 0 || bits == 0)
+ fail("error: %s [%u]\n", gnutls_strerror(ret), bits);
+
ret = gnutls_pubkey_verify_params(key);
if (ret != 0)
fail("error: %s\n", gnutls_strerror(ret));