Skip to content

Commit 359cd1a

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 5e3f2fc commit 359cd1a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/broker/overlay.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,12 @@ int overlay_set_topology (struct overlay *ov, struct topology *topo)
286286

287287
ov->size = topology_get_size (topo);
288288
ov->rank = topology_get_rank (topo);
289+
if (!cert_meta_get (ov->cert, "name")) {
290+
char val[16];
291+
snprintf (val, sizeof (val), "%lu", (unsigned long)ov->rank);
292+
if (cert_meta_set (ov->cert, "name", val) < 0)
293+
goto error;
294+
}
289295
ov->child_count = child_count;
290296
if (ov->child_count > 0) {
291297
int i;

0 commit comments

Comments
 (0)