ranap_msg_factory: CipheringInformation is optional in SecurityModeCommand
This commit is contained in:
parent
c371a42938
commit
2cf0d8f1eb
|
@ -218,8 +218,6 @@ struct msgb *ranap_new_msg_sec_mod_cmd(const uint8_t *ik, const uint8_t *ck)
|
||||||
memset(&ies, 0, sizeof(ies));
|
memset(&ies, 0, sizeof(ies));
|
||||||
memset(&out, 0, sizeof(out));
|
memset(&out, 0, sizeof(out));
|
||||||
|
|
||||||
ies.presenceMask = SECURITYMODECOMMANDIES_RANAP_ENCRYPTIONINFORMATION_PRESENT;
|
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(ip_alg); i++) {
|
for (i = 0; i < ARRAY_SIZE(ip_alg); i++) {
|
||||||
/* needs to be dynamically allocated, as
|
/* needs to be dynamically allocated, as
|
||||||
* SET_OF_free() will call FREEMEM() on it */
|
* SET_OF_free() will call FREEMEM() on it */
|
||||||
|
@ -231,6 +229,7 @@ struct msgb *ranap_new_msg_sec_mod_cmd(const uint8_t *ik, const uint8_t *ck)
|
||||||
BIT_STRING_fromBuf(&ies.integrityProtectionInformation.key, ik, 16*8);
|
BIT_STRING_fromBuf(&ies.integrityProtectionInformation.key, ik, 16*8);
|
||||||
|
|
||||||
if (ck) {
|
if (ck) {
|
||||||
|
ies.presenceMask = SECURITYMODECOMMANDIES_RANAP_ENCRYPTIONINFORMATION_PRESENT;
|
||||||
for (i = 0; i < ARRAY_SIZE(ip_alg); i++) {
|
for (i = 0; i < ARRAY_SIZE(ip_alg); i++) {
|
||||||
/* needs to be dynamically allocated, as
|
/* needs to be dynamically allocated, as
|
||||||
* SET_OF_free() will call FREEMEM() on it */
|
* SET_OF_free() will call FREEMEM() on it */
|
||||||
|
@ -248,6 +247,7 @@ struct msgb *ranap_new_msg_sec_mod_cmd(const uint8_t *ik, const uint8_t *ck)
|
||||||
|
|
||||||
/* release dynamic allocations attached to ies */
|
/* release dynamic allocations attached to ies */
|
||||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RANAP_IntegrityProtectionInformation, &ies.integrityProtectionInformation);
|
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RANAP_IntegrityProtectionInformation, &ies.integrityProtectionInformation);
|
||||||
|
if (ck)
|
||||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RANAP_EncryptionInformation, &ies.encryptionInformation);
|
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RANAP_EncryptionInformation, &ies.encryptionInformation);
|
||||||
|
|
||||||
/* out -> msg */
|
/* out -> msg */
|
||||||
|
|
Loading…
Reference in New Issue