jambonz / jambonz-webapp

A simple provisioning web app for jambonz
MIT License
5 stars 20 forks source link

Ability to specify whether to pad crypto properties when creating an outbound sip gateway using SRTP #320

Closed davehorton closed 9 months ago

davehorton commented 10 months ago

An area of confusion in the industry is whether or not to apply base64 padding (ie 0, 1, or 2 "equals" signs) to inline crypto attributes in the SDP. Example with no padding:

a=crypto:1 AEAD_AES_256_GCM inline:UjbSu5pCEPs/D7UtQWl2R+Nd7YnXoiGU6+THDz58hyXTtt94HiGM8YgCgU0
a=crypto:2 AEAD_AES_128_GCM inline:6Y7fx0D8q3OZxwKqOmQg0uD/ubV0mtgHSoj2wQ
a=crypto:3 AES_CM_128_HMAC_SHA1_80 inline:QEg6UozMTrNtbMEWLMEHvIuQ4hQSQ/UHkJm9b6sd

Example with padding:

a=crypto:1 AEAD_AES_256_GCM inline:UKQQltkBs5PsDa37SL7uEgYG3BFXDIIqYeorn76ERCcNk4poY02D/fWU74E=
a=crypto:2 AEAD_AES_128_GCM inline:hI8twp7i82SjaofbxTw7XNyrvOmqvx3A50Y4QA==
a=crypto:3 AES_CM_128_HMAC_SHA1_80 inline:ONE4xh9E7LfpxCoORp1awnUI3+IZdftiGbDQNwRK

Currently, we have an env var in SBC outbound, PAD_CRYPTO, that globally sets which way to do it. However, we should be able to set this on a sip gateway level. When the user selects "TLS/SRTP" for the protocol for an outbound SIP gateway there should appear a checkbox labeled "Pad crypto attributes". By default it should be unchecked. This setting should define whether or not for any outbound calls made through to gateway padding should be added.

davehorton commented 10 months ago

Below is a wireframe showing the new property, which is only visible for outbound gateways where TLS/SRTP is selected

image

xquanluu commented 9 months ago

closing this as PRs merged