Revert "Sign index-meta"

This reverts commit 381b7b7600.
This commit is contained in:
Juan RP 2020-01-06 14:44:22 +01:00
parent 5f1f87eeb8
commit 68113a8fc0
No known key found for this signature in database
GPG Key ID: AF19F6CB482F9368
2 changed files with 11 additions and 30 deletions

View File

@ -93,7 +93,8 @@ repodata_flush(struct xbps_handle *xhp, const char *repodir,
buf = xbps_dictionary_externalize(idx); buf = xbps_dictionary_externalize(idx);
if (buf == NULL) if (buf == NULL)
return false; return false;
rv = xbps_archive_append_buf(ar, buf, strlen(buf), buflen = strlen(buf);
rv = xbps_archive_append_buf(ar, buf, buflen,
XBPS_REPOIDX, 0644, "root", "root"); XBPS_REPOIDX, 0644, "root", "root");
free(buf); free(buf);
if (rv != 0) if (rv != 0)
@ -108,31 +109,12 @@ repodata_flush(struct xbps_handle *xhp, const char *repodir,
} else { } else {
buf = xbps_dictionary_externalize(meta); buf = xbps_dictionary_externalize(meta);
} }
buflen = strlen(buf); rv = xbps_archive_append_buf(ar, buf, strlen(buf),
rv = xbps_archive_append_buf(ar, buf, buflen,
XBPS_REPOIDX_META, 0644, "root", "root"); XBPS_REPOIDX_META, 0644, "root", "root");
free(buf);
if (rv != 0) if (rv != 0)
return false; return false;
if (xbps_dictionary_get_cstring_nocopy(meta, "signature-type", &signature_type)) {
rv = sign_buffer(buf, buflen, privkey, &sig, &siglen);
free(buf);
if (rv != 0) {
free(sig);
return false;
}
assert(sig);
rv = xbps_archive_append_buf(ar, sig, siglen,
XBPS_REPOIDXMETA_SIG, 0644, "root", "root");
if (rv != 0) {
free(sig);
return false;
}
free(sig);
} else {
free(buf);
}
/* Write data to tempfile and rename */ /* Write data to tempfile and rename */
if (archive_write_close(ar) != ARCHIVE_OK) if (archive_write_close(ar) != ARCHIVE_OK)
return false; return false;

View File

@ -116,19 +116,18 @@
*/ */
#define XBPS_REPOIDX "index.plist" #define XBPS_REPOIDX "index.plist"
/**
* @def XBPS_REPOIDX_SIG
* Filename for the signature of repository index property list.
*/
#define XBPS_REPOIDX_SIG "index.plist.sig"
/** /**
* @def XBPS_REPOIDX_META * @def XBPS_REPOIDX_META
* Filename for the repository index metadata property list. * Filename for the repository index metadata property list.
*/ */
#define XBPS_REPOIDX_META "index-meta.plist" #define XBPS_REPOIDX_META "index-meta.plist"
/**
* @def XBPS_REPOIDXMETA_SIG
* Filename for the signature of repository index metadata
* property list.
*/
#define XBPS_REPOIDXMETA_SIG "index-meta.plist.sig"
/** /**
* @def XBPS_FLAG_VERBOSE * @def XBPS_FLAG_VERBOSE
* Verbose flag that can be used in the function callbacks to alter * Verbose flag that can be used in the function callbacks to alter
@ -1369,7 +1368,7 @@ struct xbps_repo {
xbps_dictionary_t idxmeta; xbps_dictionary_t idxmeta;
/** /**
* @var uri * @var uri
* *
* URI string associated with repository. * URI string associated with repository.
*/ */
const char *uri; const char *uri;