commit d77295e3494661d565f3c3e60d10df899d4d681c from: Omar Polo via: Thomas Adam date: Fri Feb 03 15:22:13 2023 UTC got_imsg_raw_delta_request: use struct instead of buffer for id ok stsp@ commit - dd57e4abbc5d876d106027d907d8a2045a83656a commit + d77295e3494661d565f3c3e60d10df899d4d681c blob - 5516be811db3c2c4d2d45096e1c9fc8652fabe59 blob + 987d21472295c1330914aa2c9d116c3471d2e9db --- lib/got_lib_privsep.h +++ lib/got_lib_privsep.h @@ -546,7 +546,7 @@ struct got_imsg_delta { * Structure for GOT_IMSG_RAW_DELTA_REQUEST data. */ struct got_imsg_raw_delta_request { - uint8_t id[SHA1_DIGEST_LENGTH]; + struct got_object_id id; int idx; }; blob - d1c3926ffce145f1e67ee55564b78c322b9a34a3 blob + 0d1be9196af32089efcbdf9c85b3e0a3a8ee0771 --- lib/privsep.c +++ lib/privsep.c @@ -2954,7 +2954,7 @@ got_privsep_send_raw_delta_req(struct imsgbuf *ibuf, i memset(&dreq, 0, sizeof(dreq)); dreq.idx = idx; - memcpy(dreq.id, id->sha1, SHA1_DIGEST_LENGTH); + memcpy(&dreq.id, id, sizeof(dreq.id)); if (imsg_compose(ibuf, GOT_IMSG_RAW_DELTA_REQUEST, 0, 0, -1, &dreq, sizeof(dreq)) == -1) blob - 3ecb5321e9344977699d15e9f11df8e2c6eef2e3 blob + 64771eaacb0ae28618ec0ff2c995856c28fe5444 --- libexec/got-read-pack/got-read-pack.c +++ libexec/got-read-pack/got-read-pack.c @@ -880,7 +880,7 @@ raw_delta_request(struct imsg *imsg, struct imsgbuf *i if (datalen != sizeof(req)) return got_error(GOT_ERR_PRIVSEP_LEN); memcpy(&req, imsg->data, sizeof(req)); - memcpy(id.sha1, req.id, SHA1_DIGEST_LENGTH); + memcpy(&id, &req.id, sizeof(id)); imsg->fd = -1;