From: Nikos Mavrogiannopoulos Date: Mon, 27 Jan 2014 14:30:03 +0000 (+0100) Subject: Renamed get_pk functions to export. X-Git-Tag: gnutls_3_3_0pre0~247 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=196f17342bf83668186c5ca1a67dcbde5f75f96d;p=thirdparty%2Fgnutls.git Renamed get_pk functions to export. gnutls_pubkey_export_ecc_x962 replaces gnutls_pubkey_get_pk_ecc_x962 gnutls_pubkey_export_ecc_raw replaces gnutls_pubkey_get_pk_ecc_raw gnutls_pubkey_export_dsa_raw replaces gnutls_pubkey_get_pk_dsa_raw gnutls_pubkey_export_rsa_raw replaces gnutls_pubkey_get_pk_rsa_raw --- diff --git a/NEWS b/NEWS index 5900830a10..5e29194df6 100644 --- a/NEWS +++ b/NEWS @@ -71,9 +71,13 @@ gnutls_privkey_generate: Added gnutls_pkcs11_crt_is_known: Added gnutls_fips140_mode_enabled: Added gnutls_sec_param_to_symmetric_bits: Added -gnutls_privkey_get_pk_ecc_raw: Added -gnutls_privkey_get_pk_dsa_raw: Added -gnutls_privkey_get_pk_rsa_raw: Added +gnutls_pubkey_export_ecc_x962: Added (replaces gnutls_pubkey_get_pk_ecc_x962) +gnutls_pubkey_export_ecc_raw: Added (replaces gnutls_pubkey_get_pk_ecc_raw) +gnutls_pubkey_export_dsa_raw: Added (replaces gnutls_pubkey_get_pk_dsa_raw) +gnutls_pubkey_export_rsa_raw: Added (replaces gnutls_pubkey_get_pk_rsa_raw) +gnutls_privkey_export_ecc_raw: Added +gnutls_privkey_export_dsa_raw: Added +gnutls_privkey_export_rsa_raw: Added gnutls_privkey_import_ecc_raw: Added gnutls_privkey_import_dsa_raw: Added gnutls_privkey_import_rsa_raw: Added diff --git a/lib/gnutls_privkey_raw.c b/lib/gnutls_privkey_raw.c index 0d001a0bd1..dafbe11e21 100644 --- a/lib/gnutls_privkey_raw.c +++ b/lib/gnutls_privkey_raw.c @@ -35,7 +35,7 @@ #include /** - * gnutls_privkey_get_pk_rsa_raw: + * gnutls_privkey_export_rsa_raw: * @key: Holds the certificate * @m: will hold the modulus * @e: will hold the public exponent @@ -55,7 +55,7 @@ * Since: 3.3.0 **/ int -gnutls_privkey_get_pk_rsa_raw(gnutls_privkey_t key, +gnutls_privkey_export_rsa_raw(gnutls_privkey_t key, gnutls_datum_t * m, gnutls_datum_t * e, gnutls_datum_t * d, gnutls_datum_t * p, gnutls_datum_t * q, gnutls_datum_t * u, @@ -84,7 +84,7 @@ int ret; } /** - * gnutls_privkey_get_pk_dsa_raw: + * gnutls_privkey_export_dsa_raw: * @key: Holds the public key * @p: will hold the p * @q: will hold the q @@ -101,7 +101,7 @@ int ret; * Since: 3.3.0 **/ int -gnutls_privkey_get_pk_dsa_raw(gnutls_privkey_t key, +gnutls_privkey_export_dsa_raw(gnutls_privkey_t key, gnutls_datum_t * p, gnutls_datum_t * q, gnutls_datum_t * g, gnutls_datum_t * y, gnutls_datum_t * x) @@ -129,7 +129,7 @@ int ret; /** - * gnutls_privkey_get_pk_ecc_raw: + * gnutls_privkey_export_ecc_raw: * @key: Holds the public key * @curve: will hold the curve * @x: will hold the x coordinate @@ -145,7 +145,7 @@ int ret; * Since: 3.3.0 **/ int -gnutls_privkey_get_pk_ecc_raw(gnutls_privkey_t key, +gnutls_privkey_export_ecc_raw(gnutls_privkey_t key, gnutls_ecc_curve_t * curve, gnutls_datum_t * x, gnutls_datum_t * y, diff --git a/lib/gnutls_pubkey.c b/lib/gnutls_pubkey.c index f8527d9ece..18e0218d3a 100644 --- a/lib/gnutls_pubkey.c +++ b/lib/gnutls_pubkey.c @@ -772,7 +772,7 @@ gnutls_pubkey_get_key_id(gnutls_pubkey_t key, unsigned int flags, } /** - * gnutls_pubkey_get_pk_rsa_raw: + * gnutls_pubkey_export_rsa_raw: * @key: Holds the certificate * @m: will hold the modulus * @e: will hold the public exponent @@ -783,10 +783,10 @@ gnutls_pubkey_get_key_id(gnutls_pubkey_t key, unsigned int flags, * * Returns: %GNUTLS_E_SUCCESS on success, otherwise a negative error code. * - * Since: 2.12.0 + * Since: 3.3.0 **/ int -gnutls_pubkey_get_pk_rsa_raw(gnutls_pubkey_t key, +gnutls_pubkey_export_rsa_raw(gnutls_pubkey_t key, gnutls_datum_t * m, gnutls_datum_t * e) { int ret; @@ -817,8 +817,9 @@ gnutls_pubkey_get_pk_rsa_raw(gnutls_pubkey_t key, return 0; } + /** - * gnutls_pubkey_get_pk_dsa_raw: + * gnutls_pubkey_export_dsa_raw: * @key: Holds the public key * @p: will hold the p * @q: will hold the q @@ -831,10 +832,10 @@ gnutls_pubkey_get_pk_rsa_raw(gnutls_pubkey_t key, * * Returns: %GNUTLS_E_SUCCESS on success, otherwise a negative error code. * - * Since: 2.12.0 + * Since: 3.3.0 **/ int -gnutls_pubkey_get_pk_dsa_raw(gnutls_pubkey_t key, +gnutls_pubkey_export_dsa_raw(gnutls_pubkey_t key, gnutls_datum_t * p, gnutls_datum_t * q, gnutls_datum_t * g, gnutls_datum_t * y) { @@ -890,7 +891,7 @@ gnutls_pubkey_get_pk_dsa_raw(gnutls_pubkey_t key, } /** - * gnutls_pubkey_get_pk_ecc_raw: + * gnutls_pubkey_export_ecc_raw: * @key: Holds the public key * @curve: will hold the curve * @x: will hold x @@ -905,7 +906,7 @@ gnutls_pubkey_get_pk_dsa_raw(gnutls_pubkey_t key, * Since: 3.0 **/ int -gnutls_pubkey_get_pk_ecc_raw(gnutls_pubkey_t key, +gnutls_pubkey_export_ecc_raw(gnutls_pubkey_t key, gnutls_ecc_curve_t * curve, gnutls_datum_t * x, gnutls_datum_t * y) { @@ -942,7 +943,7 @@ gnutls_pubkey_get_pk_ecc_raw(gnutls_pubkey_t key, } /** - * gnutls_pubkey_get_pk_ecc_x962: + * gnutls_pubkey_export_ecc_x962: * @key: Holds the public key * @parameters: DER encoding of an ANSI X9.62 parameters * @ecpoint: DER encoding of ANSI X9.62 ECPoint @@ -953,9 +954,9 @@ gnutls_pubkey_get_pk_ecc_raw(gnutls_pubkey_t key, * * Returns: %GNUTLS_E_SUCCESS on success, otherwise a negative error code. * - * Since: 3.0 + * Since: 3.3.0 **/ -int gnutls_pubkey_get_pk_ecc_x962(gnutls_pubkey_t key, +int gnutls_pubkey_export_ecc_x962(gnutls_pubkey_t key, gnutls_datum_t * parameters, gnutls_datum_t * ecpoint) { @@ -2096,3 +2097,58 @@ int gnutls_pubkey_import_x509_raw(gnutls_pubkey_t pkey, return ret; } + +/* ABI Compatibility functions */ +#undef gnutls_pubkey_get_pk_ecc_x962 +int gnutls_pubkey_get_pk_ecc_x962(gnutls_pubkey_t key, + gnutls_datum_t * parameters, + gnutls_datum_t * ecpoint); + +int gnutls_pubkey_get_pk_ecc_x962(gnutls_pubkey_t key, + gnutls_datum_t * parameters, + gnutls_datum_t * ecpoint) +{ + return gnutls_pubkey_export_ecc_x962(key, parameters, ecpoint); +} + +#undef gnutls_pubkey_get_pk_rsa_raw +int +gnutls_pubkey_get_pk_rsa_raw(gnutls_pubkey_t key, + gnutls_datum_t * m, gnutls_datum_t * e); + +int +gnutls_pubkey_get_pk_rsa_raw(gnutls_pubkey_t key, + gnutls_datum_t * m, gnutls_datum_t * e) +{ + return gnutls_pubkey_export_rsa_raw(key, m, e); +} + +#undef gnutls_pubkey_get_pk_dsa_raw +int +gnutls_pubkey_get_pk_dsa_raw(gnutls_pubkey_t key, + gnutls_datum_t * p, gnutls_datum_t * q, + gnutls_datum_t * g, gnutls_datum_t * y); + +int +gnutls_pubkey_get_pk_dsa_raw(gnutls_pubkey_t key, + gnutls_datum_t * p, gnutls_datum_t * q, + gnutls_datum_t * g, gnutls_datum_t * y) +{ + return gnutls_pubkey_export_dsa_raw(key, p, q, g, y); +} + + +#undef gnutls_pubkey_get_pk_ecc_raw +int +gnutls_pubkey_get_pk_ecc_raw(gnutls_pubkey_t key, + gnutls_ecc_curve_t * curve, + gnutls_datum_t * x, gnutls_datum_t * y); + +int +gnutls_pubkey_get_pk_ecc_raw(gnutls_pubkey_t key, + gnutls_ecc_curve_t * curve, + gnutls_datum_t * x, gnutls_datum_t * y) +{ + return gnutls_pubkey_export_ecc_raw(key, curve, x, y); +} + diff --git a/lib/includes/gnutls/abstract.h b/lib/includes/gnutls/abstract.h index 51ed11a3f4..4a1e3acf0c 100644 --- a/lib/includes/gnutls/abstract.h +++ b/lib/includes/gnutls/abstract.h @@ -125,16 +125,23 @@ int gnutls_pubkey_get_preferred_hash_algorithm(gnutls_pubkey_t key, gnutls_digest_algorithm_t * hash, unsigned int *mand); -int gnutls_pubkey_get_pk_rsa_raw(gnutls_pubkey_t key, +#define gnutls_pubkey_get_pk_rsa_raw gnutls_pubkey_export_rsa_raw +int gnutls_pubkey_export_rsa_raw(gnutls_pubkey_t key, gnutls_datum_t * m, gnutls_datum_t * e); -int gnutls_pubkey_get_pk_dsa_raw(gnutls_pubkey_t key, + +#define gnutls_pubkey_get_pk_dsa_raw gnutls_pubkey_export_dsa_raw +int gnutls_pubkey_export_dsa_raw(gnutls_pubkey_t key, gnutls_datum_t * p, gnutls_datum_t * q, gnutls_datum_t * g, gnutls_datum_t * y); -int gnutls_pubkey_get_pk_ecc_raw(gnutls_pubkey_t key, + +#define gnutls_pubkey_get_pk_ecc_raw gnutls_pubkey_export_ecc_raw +int gnutls_pubkey_export_ecc_raw(gnutls_pubkey_t key, gnutls_ecc_curve_t * curve, gnutls_datum_t * x, gnutls_datum_t * y); -int gnutls_pubkey_get_pk_ecc_x962(gnutls_pubkey_t key, + +#define gnutls_pubkey_get_pk_ecc_x962 gnutls_pubkey_export_ecc_x962 +int gnutls_pubkey_export_ecc_x962(gnutls_pubkey_t key, gnutls_datum_t * parameters, gnutls_datum_t * ecpoint); @@ -367,7 +374,7 @@ int gnutls_privkey_decrypt_data(gnutls_privkey_t key, gnutls_datum_t * plaintext); int -gnutls_privkey_get_pk_rsa_raw(gnutls_privkey_t key, +gnutls_privkey_export_rsa_raw(gnutls_privkey_t key, gnutls_datum_t * m, gnutls_datum_t * e, gnutls_datum_t * d, gnutls_datum_t * p, gnutls_datum_t * q, gnutls_datum_t * u, @@ -375,13 +382,13 @@ gnutls_privkey_get_pk_rsa_raw(gnutls_privkey_t key, gnutls_datum_t * e2); int -gnutls_privkey_get_pk_dsa_raw(gnutls_privkey_t key, +gnutls_privkey_export_dsa_raw(gnutls_privkey_t key, gnutls_datum_t * p, gnutls_datum_t * q, gnutls_datum_t * g, gnutls_datum_t * y, gnutls_datum_t * x); int -gnutls_privkey_get_pk_ecc_raw(gnutls_privkey_t key, +gnutls_privkey_export_ecc_raw(gnutls_privkey_t key, gnutls_ecc_curve_t * curve, gnutls_datum_t * x, gnutls_datum_t * y, diff --git a/lib/libgnutls.map b/lib/libgnutls.map index 5fffbe8f5c..9878826db3 100644 --- a/lib/libgnutls.map +++ b/lib/libgnutls.map @@ -930,12 +930,16 @@ GNUTLS_3_1_0 { gnutls_record_check_corked; gnutls_pkcs11_crt_is_known; gnutls_sec_param_to_symmetric_bits; - gnutls_privkey_get_pk_ecc_raw; - gnutls_privkey_get_pk_dsa_raw; - gnutls_privkey_get_pk_rsa_raw; + gnutls_privkey_export_ecc_raw; + gnutls_privkey_export_dsa_raw; + gnutls_privkey_export_rsa_raw; gnutls_privkey_import_rsa_raw; gnutls_privkey_import_dsa_raw; gnutls_privkey_import_ecc_raw; + gnutls_pubkey_export_ecc_x962; + gnutls_pubkey_export_ecc_raw; + gnutls_pubkey_export_dsa_raw; + gnutls_pubkey_export_rsa_raw; } GNUTLS_3_0_0; GNUTLS_PRIVATE {