[pulseaudio-commits] Branch 'next' - 2 commits - src/modules vala/libpulse.vapi
Tanu Kaskinen
tanuk at kemper.freedesktop.org
Sat Jan 7 00:37:46 UTC 2017
src/modules/raop/raop_client.c | 22 ++++++
vala/libpulse.vapi | 136 ++++++++++++++++++++---------------------
2 files changed, 88 insertions(+), 70 deletions(-)
New commits:
commit 1ae0d9e68fe34755c990b118f005a1d3f01c8028
Author: Tanu Kaskinen <tanuk at iki.fi>
Date: Fri Nov 4 14:43:57 2016 +0200
raop: add compatibility with openssl 1.1.0
Openssl 1.1.0 made all structs opaque, which caused a build failure in
raop_client.c. The struct member assignments are now replaced with a
call to RSA_set0_key().
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=96726
Reviewed-by: Felipe Sateler <fsateler at debian.org>
diff --git a/src/modules/raop/raop_client.c b/src/modules/raop/raop_client.c
index a5dd29c..31e0fdc 100644
--- a/src/modules/raop/raop_client.c
+++ b/src/modules/raop/raop_client.c
@@ -68,6 +68,21 @@
#define RAOP_PORT 5000
+/* Openssl 1.1.0 broke compatibility. Before 1.1.0 we had to set RSA->n and
+ * RSA->e manually, but after 1.1.0 the RSA struct is opaque and we have to use
+ * RSA_set0_key(). RSA_set0_key() is a new function added in 1.1.0. We could
+ * depend on openssl 1.1.0, but it may take some time before distributions will
+ * be able to upgrade to the new openssl version. To insulate ourselves from
+ * such transition problems, let's implement RSA_set0_key() ourselves if it's
+ * not available. */
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+static int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d) {
+ r->n = n;
+ r->e = e;
+ return 1;
+}
+#endif
+
struct pa_raop_client {
pa_core *core;
char *host;
@@ -161,12 +176,15 @@ static int rsa_encrypt(uint8_t *text, int len, uint8_t *res) {
uint8_t exponent[8];
int size;
RSA *rsa;
+ BIGNUM *n_bn;
+ BIGNUM *e_bn;
rsa = RSA_new();
size = pa_base64_decode(n, modules);
- rsa->n = BN_bin2bn(modules, size, NULL);
+ n_bn = BN_bin2bn(modules, size, NULL);
size = pa_base64_decode(e, exponent);
- rsa->e = BN_bin2bn(exponent, size, NULL);
+ e_bn = BN_bin2bn(exponent, size, NULL);
+ RSA_set0_key(rsa, n_bn, e_bn, NULL);
size = RSA_public_encrypt(len, text, res, rsa, RSA_PKCS1_OAEP_PADDING);
RSA_free(rsa);
commit fcec03849baac75dd3cfd55022e3458f1fe41e4f
Author: Corentin Noël <corentin at elementary.io>
Date: Mon Dec 26 11:52:06 2016 +0100
vala: use the correct syntax
Constants should be declared simply with "const". With struct members,
"static" means that all struct instances share the same variable, i.e.
all instances always see the same value. That's of course already
implied in the concept of "constant". Newer Vala versions don't allow
mixing "const" and "static".
diff --git a/vala/libpulse.vapi b/vala/libpulse.vapi
index 207cedf..107b745 100644
--- a/vala/libpulse.vapi
+++ b/vala/libpulse.vapi
@@ -110,7 +110,7 @@ namespace PulseAudio {
public uint8 channels;
[CCode (cname="PA_SAMPLE_SPEC_SNPRINT_MAX")]
- public static const size_t SNPRINT_MAX;
+ public const size_t SNPRINT_MAX;
[CCode (cname="pa_bytes_per_second")]
public size_t bytes_per_second();
@@ -170,23 +170,23 @@ namespace PulseAudio {
public struct Volume : uint32 {
[CCode (cname="PA_SW_VOLUME_SNPRINT_DB_MAX")]
- public static const size_t SW_SNPRINT_DB_MAX;
+ public const size_t SW_SNPRINT_DB_MAX;
[CCode (cname="PA_VOLUME_SNPRINT_MAX")]
- public static const size_t SNPRINT_MAX;
+ public const size_t SNPRINT_MAX;
[CCode (cname="PA_VOLUME_MAX")]
- public static const Volume MAX;
+ public const Volume MAX;
[CCode (cname="PA_VOLUME_NORM")]
- public static const Volume NORM;
+ public const Volume NORM;
[CCode (cname="PA_VOLUME_MUTED")]
- public static const Volume MUTED;
+ public const Volume MUTED;
// [CCode (cname="PA_VOLUME_INVALID")]
[CCode (cname="PA_VOLUME_MAX")]
- public static const Volume INVALID;
+ public const Volume INVALID;
[CCode (cname="pa_volume_snprint", instance_pos = 3.1)]
public unowned string snprint(char[] s);
@@ -245,10 +245,10 @@ namespace PulseAudio {
public Volume values[32];
[CCode (cname="PA_SW_CVOLUME_SNPRINT_DB_MAX")]
- public static const size_t SW_SNPRINT_DB_MAX;
+ public const size_t SW_SNPRINT_DB_MAX;
[CCode (cname="PA_CVOLUME_SNPRINT_MAX")]
- public static const size_t SNPRINT_MAX;
+ public const size_t SNPRINT_MAX;
[CCode (cname="pa_cvolume_equal")]
public bool equal(CVolume other);
@@ -382,7 +382,7 @@ namespace PulseAudio {
public ChannelPosition map[32];
[CCode (cname="PA_CHANNEL_MAP_SNPRINT_MAX")]
- public static const size_t SNPRINT_MAX;
+ public const size_t SNPRINT_MAX;
[CCode (cname="pa_channel_map_init")]
public ChannelMap();
@@ -532,121 +532,121 @@ namespace PulseAudio {
public class Proplist {
[CCode (cname="PA_PROP_MEDIA_NAME")]
- public static const string PROP_MEDIA_NAME;
+ public const string PROP_MEDIA_NAME;
[CCode (cname="PA_PROP_MEDIA_TITLE")]
- public static const string PROP_MEDIA_TITLE;
+ public const string PROP_MEDIA_TITLE;
[CCode (cname="PA_PROP_MEDIA_ARTIST")]
- public static const string PROP_MEDIA_ARTIST;
+ public const string PROP_MEDIA_ARTIST;
[CCode (cname="PA_PROP_MEDIA_COPYRIGHT")]
- public static const string PROP_MEDIA_COPYRIGHT;
+ public const string PROP_MEDIA_COPYRIGHT;
[CCode (cname="PA_PROP_MEDIA_SOFTWARE")]
- public static const string PROP_MEDIA_SOFTWARE;
+ public const string PROP_MEDIA_SOFTWARE;
[CCode (cname="PA_PROP_MEDIA_LANGUAGE")]
- public static const string PROP_MEDIA_LANGUAGE;
+ public const string PROP_MEDIA_LANGUAGE;
[CCode (cname="PA_PROP_MEDIA_FILENAME")]
- public static const string PROP_MEDIA_FILENAME;
+ public const string PROP_MEDIA_FILENAME;
[CCode (cname="PA_PROP_MEDIA_ICON_NAME")]
- public static const string PROP_MEDIA_ICON_NAME;
+ public const string PROP_MEDIA_ICON_NAME;
[CCode (cname="PA_PROP_MEDIA_ROLE")]
- public static const string PROP_MEDIA_ROLE;
+ public const string PROP_MEDIA_ROLE;
[CCode (cname="PA_PROP_EVENT_ID")]
- public static const string PROP_EVENT_ID;
+ public const string PROP_EVENT_ID;
[CCode (cname="PA_PROP_EVENT_DESCRIPTION")]
- public static const string PROP_EVENT_DESCRIPTION;
+ public const string PROP_EVENT_DESCRIPTION;
[CCode (cname="PA_PROP_EVENT_MOUSE_X")]
- public static const string PROP_EVENT_MOUSE_X;
+ public const string PROP_EVENT_MOUSE_X;
[CCode (cname="PA_PROP_EVENT_MOUSE_Y")]
- public static const string PROP_EVENT_MOUSE_Y;
+ public const string PROP_EVENT_MOUSE_Y;
[CCode (cname="PA_PROP_EVENT_MOUSE_HPOS")]
- public static const string PROP_EVENT_MOUSE_HPOS;
+ public const string PROP_EVENT_MOUSE_HPOS;
[CCode (cname="PA_PROP_EVENT_MOUSE_VPOS")]
- public static const string PROP_EVENT_MOUSE_VPOS;
+ public const string PROP_EVENT_MOUSE_VPOS;
[CCode (cname="PA_PROP_EVENT_MOUSE_BUTTON")]
- public static const string PROP_EVENT_MOUSE_BUTTON;
+ public const string PROP_EVENT_MOUSE_BUTTON;
[CCode (cname="PA_PROP_WINDOW_NAME")]
- public static const string PROP_WINDOW_NAME;
+ public const string PROP_WINDOW_NAME;
[CCode (cname="PA_PROP_WINDOW_ID")]
- public static const string PROP_WINDOW_ID;
+ public const string PROP_WINDOW_ID;
[CCode (cname="PA_PROP_WINDOW_ICON_NAME")]
- public static const string PROP_WINDOW_ICON_NAME;
+ public const string PROP_WINDOW_ICON_NAME;
[CCode (cname="PA_PROP_WINDOW_X11_DISPLAY")]
- public static const string PROP_WINDOW_X11_DISPLAY;
+ public const string PROP_WINDOW_X11_DISPLAY;
[CCode (cname="PA_PROP_WINDOW_X11_SCREEN")]
- public static const string PROP_WINDOW_X11_SCREEN;
+ public const string PROP_WINDOW_X11_SCREEN;
[CCode (cname="PA_PROP_WINDOW_X11_MONITOR")]
- public static const string PROP_WINDOW_X11_MONITOR;
+ public const string PROP_WINDOW_X11_MONITOR;
[CCode (cname="PA_PROP_WINDOW_X11_XID")]
- public static const string PROP_WINDOW_X11_XID;
+ public const string PROP_WINDOW_X11_XID;
[CCode (cname="PA_PROP_APPLICATION_NAME")]
- public static const string PROP_APPLICATION_NAME;
+ public const string PROP_APPLICATION_NAME;
[CCode (cname="PA_PROP_APPLICATION_ID")]
- public static const string PROP_APPLICATION_ID;
+ public const string PROP_APPLICATION_ID;
[CCode (cname="PA_PROP_APPLICATION_VERSION")]
- public static const string PROP_APPLICATION_VERSION;
+ public const string PROP_APPLICATION_VERSION;
[CCode (cname="PA_PROP_APPLICATION_ICON_NAME")]
- public static const string PROP_APPLICATION_ICON_NAME;
+ public const string PROP_APPLICATION_ICON_NAME;
[CCode (cname="PA_PROP_APPLICATION_LANGUAGE")]
- public static const string PROP_APPLICATION_LANGUAGE;
+ public const string PROP_APPLICATION_LANGUAGE;
[CCode (cname="PA_PROP_APPLICATION_PROCESS_ID")]
- public static const string PROP_APPLICATION_PROCESS_ID;
+ public const string PROP_APPLICATION_PROCESS_ID;
[CCode (cname="PA_PROP_APPLICATION_PROCESS_BINARY")]
- public static const string PROP_APPLICATION_PROCESS_BINARY;
+ public const string PROP_APPLICATION_PROCESS_BINARY;
[CCode (cname="PA_PROP_APPLICATION_PROCESS_USER")]
- public static const string PROP_APPLICATION_PROCESS_USER;
+ public const string PROP_APPLICATION_PROCESS_USER;
[CCode (cname="PA_PROP_APPLICATION_PROCESS_HOST")]
- public static const string PROP_APPLICATION_PROCESS_HOST;
+ public const string PROP_APPLICATION_PROCESS_HOST;
[CCode (cname="PA_PROP_APPLICATION_PROCESS_MACHINE_ID")]
- public static const string PROP_APPLICATION_PROCESS_MACHINE_ID;
+ public const string PROP_APPLICATION_PROCESS_MACHINE_ID;
[CCode (cname="PA_PROP_APPLICATION_PROCESS_SESSION_ID")]
- public static const string PROP_APPLICATION_PROCESS_SESSION_ID;
+ public const string PROP_APPLICATION_PROCESS_SESSION_ID;
[CCode (cname="PA_PROP_DEVICE_STRING")]
- public static const string PROP_DEVICE_STRING;
+ public const string PROP_DEVICE_STRING;
[CCode (cname="PA_PROP_DEVICE_API")]
- public static const string PROP_DEVICE_API;
+ public const string PROP_DEVICE_API;
[CCode (cname="PA_PROP_DEVICE_DESCRIPTION")]
- public static const string PROP_DEVICE_DESCRIPTION;
+ public const string PROP_DEVICE_DESCRIPTION;
[CCode (cname="PA_PROP_DEVICE_BUS_PATH")]
- public static const string PROP_DEVICE_BUS_PATH;
+ public const string PROP_DEVICE_BUS_PATH;
[CCode (cname="PA_PROP_DEVICE_SERIAL")]
- public static const string PROP_DEVICE_SERIAL;
+ public const string PROP_DEVICE_SERIAL;
[CCode (cname="PA_PROP_DEVICE_VENDOR_ID")]
- public static const string PROP_DEVICE_VENDOR_ID;
+ public const string PROP_DEVICE_VENDOR_ID;
[CCode (cname="PA_PROP_DEVICE_VENDOR_NAME")]
- public static const string PROP_DEVICE_VENDOR_NAME;
+ public const string PROP_DEVICE_VENDOR_NAME;
[CCode (cname="PA_PROP_DEVICE_PRODUCT_ID")]
- public static const string PROP_DEVICE_PRODUCT_ID;
+ public const string PROP_DEVICE_PRODUCT_ID;
[CCode (cname="PA_PROP_DEVICE_PRODUCT_NAME")]
- public static const string PROP_DEVICE_PRODUCT_NAME;
+ public const string PROP_DEVICE_PRODUCT_NAME;
[CCode (cname="PA_PROP_DEVICE_CLASS")]
- public static const string PROP_DEVICE_CLASS;
+ public const string PROP_DEVICE_CLASS;
[CCode (cname="PA_PROP_DEVICE_FORM_FACTOR")]
- public static const string PROP_DEVICE_FORM_FACTOR;
+ public const string PROP_DEVICE_FORM_FACTOR;
[CCode (cname="PA_PROP_DEVICE_BUS")]
- public static const string PROP_DEVICE_BUS;
+ public const string PROP_DEVICE_BUS;
[CCode (cname="PA_PROP_DEVICE_ICON_NAME")]
- public static const string PROP_DEVICE_ICON_NAME;
+ public const string PROP_DEVICE_ICON_NAME;
[CCode (cname="PA_PROP_DEVICE_ACCESS_MODE")]
- public static const string PROP_DEVICE_ACCESS_MODE;
+ public const string PROP_DEVICE_ACCESS_MODE;
[CCode (cname="PA_PROP_DEVICE_MASTER_DEVICE")]
- public static const string PROP_DEVICE_MASTER_DEVICE;
+ public const string PROP_DEVICE_MASTER_DEVICE;
[CCode (cname="PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE")]
- public static const string PROP_DEVICE_BUFFERING_BUFFER_SIZE;
+ public const string PROP_DEVICE_BUFFERING_BUFFER_SIZE;
[CCode (cname="PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE")]
- public static const string PROP_DEVICE_BUFFERING_FRAGMENT_SIZE;
+ public const string PROP_DEVICE_BUFFERING_FRAGMENT_SIZE;
[CCode (cname="PA_PROP_DEVICE_PROFILE_NAME")]
- public static const string PROP_DEVICE_PROFILE_NAME;
+ public const string PROP_DEVICE_PROFILE_NAME;
[CCode (cname="PA_PROP_DEVICE_INTENDED_ROLES")]
- public static const string PROP_DEVICE_INTENDED_ROLES;
+ public const string PROP_DEVICE_INTENDED_ROLES;
[CCode (cname="PA_PROP_DEVICE_PROFILE_DESCRIPTION")]
- public static const string PROP_DEVICE_PROFILE_DESCRIPTION;
+ public const string PROP_DEVICE_PROFILE_DESCRIPTION;
[CCode (cname="PA_PROP_MODULE_AUTHOR")]
- public static const string PROP_MODULE_AUTHOR;
+ public const string PROP_MODULE_AUTHOR;
[CCode (cname="PA_PROP_MODULE_DESCRIPTION")]
- public static const string PROP_MODULE_DESCRIPTION;
+ public const string PROP_MODULE_DESCRIPTION;
[CCode (cname="PA_PROP_MODULE_USAGE")]
- public static const string PROP_MODULE_USAGE;
+ public const string PROP_MODULE_USAGE;
[CCode (cname="PA_PROP_MODULE_VERSION")]
- public static const string PROP_MODULE_VERSION;
+ public const string PROP_MODULE_VERSION;
[CCode (cname="pa_proplist_new")]
public Proplist();
More information about the pulseaudio-commits
mailing list