From 6b6ff7bb2b0572c770e741287176a3cd7cf01ae3 Mon Sep 17 00:00:00 2001 From: Johan Pascal Date: Mon, 28 Apr 2014 22:03:27 +0200 Subject: [PATCH] Don't send message in plain if no cache is found --- coreapi/bellesip_sal/sal_op_message.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/coreapi/bellesip_sal/sal_op_message.c b/coreapi/bellesip_sal/sal_op_message.c index 0e7009858..3897dd9cb 100644 --- a/coreapi/bellesip_sal/sal_op_message.c +++ b/coreapi/bellesip_sal/sal_op_message.c @@ -229,6 +229,9 @@ int sal_message_send(SalOp *op, const char *from, const char *to, const char* co FILE *CACHEFD = fopen(lc->zrtp_secrets_cache, "r+"); if (CACHEFD == NULL) { ms_warning("Unable to access ZRTP ZID cache to encrypt message"); + sal_error_info_set(&op->error_info, SalReasonNotAcceptable, 488, "Unable to encrypt IM", NULL); + op->base.root->callbacks.text_delivery_update(op,SalTextDeliveryFailed); + return 0; } else { fseek(CACHEFD, 0L, SEEK_END); /* Position to end of file */ int cacheSize = ftell(CACHEFD); /* Get file length */