]> git.ipfire.org Git - thirdparty/asterisk.git/commit
channels/sip/sdp_crypto: Handle SRTP keys negotiated with key lifetime/MKI
authorMatthew Jordan <mjordan@digium.com>
Wed, 25 Feb 2015 21:13:39 +0000 (21:13 +0000)
committerMatthew Jordan <mjordan@digium.com>
Wed, 25 Feb 2015 21:13:39 +0000 (21:13 +0000)
commitaf498bf03e5d27265e753b81d6c0d40d2c53c5d8
tree1d13dd452b227e3f8563175d75c5d25cb7858de5
parent551b35e8228bf01324de39c629929387f6da5e05
channels/sip/sdp_crypto: Handle SRTP keys negotiated with key lifetime/MKI

Prior to this patch, SDP offers negotiating SDES-SRTP crypto attributes would
be rejected if those crypto attributes contained either a key lifetime or a
MKI parameter. While from a theoretical point of view this was defensible -
Asterisk does not support key lifetimes or multiple crypto keys - from a
practical point of view, this is quite a problem. A large number of endpoints
offer lifetimes/MKI, which Asterisk can tolerate so long as it doesn't actually
have to support anything more than a single key or refresh the key.
In reality, this is (so far as we've seen) always the case.

This patch is a forward port of Olle's work in the lingon-srtp-key-lifetime-1.8
branch. To quote Olle from ASTERISK-17721, it handles lifetime/MKI parameters
in the following fashion:

> The Lingon branch now handle lifetime and MKI parameters.
>
> We only accept lifetimes up to max for the crypto and higher than 10 hours
> for packetization of 20 ms (50 pps).
>
> We only handle MKI with index 1.
>
> We do not really bother with counting packets and reinviting at end of
> lifetime, so the min of 10 hours kind of takes care of most calls. If there
> are longer ones, we rely on the other side for re-invites.
>
> It's still not perfect, but I personally think this is an improvement. A
> configuration option for minimum lifetime accepted could be added.

When the patch was ported forward, I decided against adding a configuration
option as Olle's handling was more than sufficient for every case I've seen
come through the issue tracker or through interoperability testing. We can
revisit that decision if it proves to be false.

A few small other tweaks were made to the surrounding code to reduce
indentation and provide better type safety for the 'tag' parameter.

Review: https://reviewboard.asterisk.org/r/4419/
Review: https://reviewboard.asterisk.org/r/4418/

ASTERISK-17721 #close
Reported by: Terry Wilson

ASTERISK-17899 #close
Reported by: Dwayne Hubbard
patches:
  lingon-srtp-key-lifetime-1.8.diff uploaded by oej (License 5267)

ASTERISK-20233
Reported by: tootai

ASTERISK-22748
Reported by: Alejandro Mejia

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@432239 65c4cc65-6c06-0410-ace0-fbb531ad65f3
channels/sip/sdp_crypto.c