summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/crypt.c3
-rw-r--r--src/lib/dev.c9
2 files changed, 7 insertions, 5 deletions
diff --git a/src/lib/crypt.c b/src/lib/crypt.c
index cda3cb46..06cc1749 100644
--- a/src/lib/crypt.c
+++ b/src/lib/crypt.c
@@ -365,8 +365,9 @@ static int crypt_dh_pkp_create(void ** pkp,
(void) pk;
memset(pk, 0, MSGBUFSZ);
+ *pkp = NULL;
- return -ECRYPT;
+ return 0;
#endif
}
diff --git a/src/lib/dev.c b/src/lib/dev.c
index a6be762b..0a783bf7 100644
--- a/src/lib/dev.c
+++ b/src/lib/dev.c
@@ -552,10 +552,11 @@ int flow_accept(qosspec_t * qs,
err = -ECRYPT;
goto fail_crypt_pkp;
}
-
- msg.has_pk = true;
- msg.pk.data = buf;
- msg.pk.len = (uint32_t) key_len;
+ if (key_len > 0) {
+ msg.has_pk = true;
+ msg.pk.data = buf;
+ msg.pk.len = (uint32_t) key_len;
+ }
pthread_cleanup_push(crypt_dh_pkp_destroy, pkp);