debug log: a_iface_tx_cipher_mode(): log cipher and key

Introduce LOGPCONN() which would also be useful in numerous other places in
this file.

Change-Id: Ib406d6e6784342341e716206997e382c702ac9d2
diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c
index 83ec82f..f863517 100644
--- a/src/libmsc/a_iface.c
+++ b/src/libmsc/a_iface.c
@@ -39,9 +39,15 @@
 #include <osmocom/sccp/sccp_types.h>
 #include <osmocom/msc/a_reset.h>
 #include <osmocom/msc/osmo_msc.h>
+#include <osmocom/msc/vlr.h>
 
 #include <errno.h>
 
+#define LOGPCONN(conn, level, fmt, args...) \
+	LOGP(DMSC, level, "(subscr %s, conn_id %d) " fmt, \
+	     vlr_subscr_name(conn ? conn->vsub : NULL), conn ? conn->a.conn_id : -1, \
+	     ## args)
+
 /* A pointer to the GSM network we work with. By the current paradigm,
  * there can only be one gsm_network per MSC. The pointer is set once
  * when calling a_init() */
@@ -172,10 +178,12 @@
 
 	OSMO_ASSERT(conn);
 
-	LOGP(DMSC, LOGL_DEBUG, "Passing Cipher mode command message from MSC to BSC (conn_id=%i)\n", conn->a.conn_id);
 	uint8_t crm = 0x01;
 	uint8_t *crm_ptr = NULL;
 
+	LOGPCONN(conn, LOGL_DEBUG, "Cipher Mode Command to BSC, cipher=%d key=%s\n",
+		 cipher, osmo_hexdump_nospc(key, len));
+
 	/* Setup encryption information */
 	if (len > ENCRY_INFO_KEY_MAXLEN || !key) {
 		LOGP(DMSC, LOGL_ERROR,