Skip to content

Commit 2ffd96b

Browse files
committed
broker: ensure CURVE certificate has a name
Problem: internally generated curve certs are not named, so overlay_cert_name() can return NULL, but a name is required when authorizing a cert. This API inconsistency results in extra code and confusion when implementing a new boot method. Use the rank as the name for internally generated certs.
1 parent 98d7b2a commit 2ffd96b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/broker/overlay.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,11 @@ int overlay_set_topology (struct overlay *ov, struct topology *topo)
279279

280280
ov->size = topology_get_size (topo);
281281
ov->rank = topology_get_rank (topo);
282+
if (!zcert_meta (ov->cert, "name")) {
283+
char buf[16];
284+
snprintf (buf, sizeof (buf), "%lu", (unsigned long)ov->rank);
285+
zcert_set_meta (ov->cert, "name", "%s", buf);
286+
}
282287
ov->child_count = child_count;
283288
if (ov->child_count > 0) {
284289
int i;

0 commit comments

Comments
 (0)