From 0c1214935fc54071c964ac2aa3e4609e9fcfa724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B8=D0=BB=D1=8F=D0=BD=20=D0=9F=D0=B0=D0=BB=D0=B0?= =?UTF-8?q?=D1=83=D0=B7=D0=BE=D0=B2?= Date: Sun, 25 Feb 2024 14:11:53 +0100 Subject: [PATCH] =?UTF-8?q?sip:=20calls=5Fsdp=5Fcrypto=5Fcontext=5Fgenerat?= =?UTF-8?q?e=5Fanswer()=20=E2=80=94=20simplify?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/provider/sip/calls-sdp-crypto-context.c | 15 +++++---------- plugins/provider/sip/calls-srtp-utils.h | 4 ++-- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/plugins/provider/sip/calls-sdp-crypto-context.c b/plugins/provider/sip/calls-sdp-crypto-context.c index 1cf6d7b..726e65c 100644 --- a/plugins/provider/sip/calls-sdp-crypto-context.c +++ b/plugins/provider/sip/calls-sdp-crypto-context.c @@ -468,8 +468,6 @@ calls_sdp_crypto_context_generate_offer (CallsSdpCryptoContext *self) gboolean calls_sdp_crypto_context_generate_answer (CallsSdpCryptoContext *self) { - calls_srtp_crypto_attribute *attr = NULL; - g_return_val_if_fail (CALLS_IS_SDP_CRYPTO_CONTEXT (self), FALSE); if (self->state != CALLS_CRYPTO_CONTEXT_STATE_OFFER_REMOTE) { @@ -482,20 +480,17 @@ calls_sdp_crypto_context_generate_answer (CallsSdpCryptoContext *self) calls_srtp_crypto_attribute *attr_offer = node->data; if (crypto_attribute_is_supported (self, attr_offer)) { - attr = calls_srtp_crypto_attribute_new (1); + calls_srtp_crypto_attribute *attr = calls_srtp_crypto_attribute_new (1); + attr->crypto_suite = attr_offer->crypto_suite; attr->tag = attr_offer->tag; calls_srtp_crypto_attribute_init_keys (attr); - break; + self->local_crypto_attributes = g_list_append (NULL, attr); + return update_state (self); } } - if (!attr) - return FALSE; - - self->local_crypto_attributes = g_list_append (NULL, attr); - - return update_state (self); + return FALSE; } diff --git a/plugins/provider/sip/calls-srtp-utils.h b/plugins/provider/sip/calls-srtp-utils.h index d807275..94d097f 100644 --- a/plugins/provider/sip/calls-srtp-utils.h +++ b/plugins/provider/sip/calls-srtp-utils.h @@ -32,8 +32,8 @@ typedef enum { CALLS_SRTP_SUITE_UNKNOWN = 0, CALLS_SRTP_SUITE_AES_CM_128_SHA1_32, /* RFC 4568 */ CALLS_SRTP_SUITE_AES_CM_128_SHA1_80, /* RFC 4568 */ - CALLS_SRTP_SUITE_AES_192_CM_SHA1_32, /* RFC 6188 not supperted by Gst */ - CALLS_SRTP_SUITE_AES_192_CM_SHA1_80, /* RFC 6188 not supperted by Gst */ + CALLS_SRTP_SUITE_AES_192_CM_SHA1_32, /* RFC 6188 not supported by Gst */ + CALLS_SRTP_SUITE_AES_192_CM_SHA1_80, /* RFC 6188 not supported by Gst */ CALLS_SRTP_SUITE_AES_256_CM_SHA1_32, /* RFC 6188 */ CALLS_SRTP_SUITE_AES_256_CM_SHA1_80, /* RFC 6188 */ CALLS_SRTP_SUITE_F8_128_HMAC_SHA1_32, /* RFC 4568 but not supported by GstSrtpEnc/GstSrtpDec */