| 142 | } |
| 143 | |
| 144 | bool cbm_daemon_rendezvous_key(char out[CBM_DAEMON_KEY_SIZE]) { |
| 145 | if (!out) { |
| 146 | return false; |
| 147 | } |
| 148 | /* This product-domain string is intentionally the only key input. Account |
| 149 | * isolation comes from the authenticated IPC runtime, not spoofable text. */ |
| 150 | static const unsigned char domain[] = "codebase-memory-mcp:coordination-daemon"; |
| 151 | uint64_t hash = 14695981039346656037ULL; |
| 152 | for (size_t i = 0; i < sizeof(domain) - 1; i++) { |
| 153 | hash ^= domain[i]; |
| 154 | hash *= 1099511628211ULL; |
| 155 | } |
| 156 | int written = snprintf(out, CBM_DAEMON_KEY_SIZE, "%016llx", (unsigned long long)hash); |
| 157 | if (written != (int)CBM_DAEMON_KEY_SIZE - 1) { |
| 158 | out[0] = '\0'; |
| 159 | return false; |
| 160 | } |
| 161 | return true; |
| 162 | } |
| 163 | |
| 164 | cbm_daemon_hello_status_t cbm_daemon_hello_compare(const cbm_daemon_build_identity_t *active, |
| 165 | const cbm_daemon_build_identity_t *requested, |
no outgoing calls