< Previous by Date Date Index Next by Date >
  Thread Index Next in Thread >

[recon-devel] SRTP: generate the local session key


Hi, I'm reading recon source code this week, I found this code in
unsigned int RemoteParticipantDialogSet::getLocalRTPPort():


      // Set other Srtp properties
      mLocalSrtpSessionKey = Random::getCryptoRandom(SRTP_MASTER_KEY_LEN);


And this code in void RemoteParticipant::buildSdpOffer:

      case flowmanager::MediaStream::SRTP_AES_CM_128_HMAC_SHA1_32:
         crypto = "1 AES_CM_128_HMAC_SHA1_32 inline:" + mDialogSet.getLocalSrtpSessionKey().base64encode(); 
         audioMedium->addAttribute("crypto", crypto);
         crypto = "2 AES_CM_128_HMAC_SHA1_80 inline:" + mDialogSet.getLocalSrtpSessionKey().base64encode();
         audioMedium->addAttribute("crypto", crypto);
         break;
      default:
         crypto = "1 AES_CM_128_HMAC_SHA1_80 inline:" + mDialogSet.getLocalSrtpSessionKey().base64encode();
         audioMedium->addAttribute("crypto", crypto);
         crypto = "2 AES_CM_128_HMAC_SHA1_32 inline:" + mDialogSet.getLocalSrtpSessionKey().base64encode();
         audioMedium->addAttribute("crypto", crypto);
         break;


In the RFC 4568:
a = crypto : <tag> <crypto-suite> <key – params>[<sesson-params>]
and the "key – params" has included "["|" lifetime] ["|" MKI ":" length]" sub items,

So within recon, just used a random value for the "key – params"  and does not support lifetime and MKI, right ?

Thanks