Review at  https://gerrit.osmocom.org/128

sgsn: fix use of libosmocore GPRS encryption plugins from LLC layer

Instead of passing the uint64_t kc bytes wrongly interpreted as memory address,
pass its actual kc bytes by casting via (uint8_t*)&kc.

Change-Id: I1f1b7454a0de5b7f4734aca4d03dbe67db5de189
---
M openbsc/src/gprs/gprs_llc.c
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/28/128/1

diff --git a/openbsc/src/gprs/gprs_llc.c b/openbsc/src/gprs/gprs_llc.c
index 4cf5163..e3c0726 100644
--- a/openbsc/src/gprs/gprs_llc.c
+++ b/openbsc/src/gprs/gprs_llc.c
@@ -417,7 +417,7 @@

                /* Compute the keystream that we need to XOR with the data */
                rc = gprs_cipher_run(cipher_out, crypt_len, lle->llme->algo,
-                                    kc, iv, GPRS_CIPH_SGSN2MS);
+                                    (uint8_t*)&kc, iv, GPRS_CIPH_SGSN2MS);
                if (rc < 0) {
                        LOGP(DLLC, LOGL_ERROR, "Error crypting UI frame: %d\n", 
rc);
                        msgb_free(msg);
@@ -623,7 +623,7 @@
                iv = gprs_cipher_gen_input_ui(iov_ui, lle->sapi, llhp.seq_tx,
                                                lle->oc_ui_recv);
                rc = gprs_cipher_run(cipher_out, crypt_len, lle->llme->algo,
-                                    kc, iv, GPRS_CIPH_MS2SGSN);
+                                    (uint8_t*)&kc, iv, GPRS_CIPH_MS2SGSN);
                if (rc < 0) {
                        LOGP(DLLC, LOGL_ERROR, "Error decrypting frame: %d\n",
                             rc);

-- 
To view, visit https://gerrit.osmocom.org/128
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f1b7454a0de5b7f4734aca4d03dbe67db5de189
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <[email protected]>

Reply via email to