goto release_tmp;
/* rfc8181#section-2.2, get the file from the uri */
- error = uri_create_mixed_str(&uri, tmp->doc_data.uri,
+ error = uri_create_rsync_str(&uri, tmp->doc_data.uri,
strlen(tmp->doc_data.uri));
if (error)
goto release_tmp;
size_t written;
int error;
- error = uri_create_mixed_str(&uri, location, strlen(location));
+ /* rfc8181#section-2.2 must be an rsync URI */
+ error = uri_create_rsync_str(&uri, location, strlen(location));
if (error)
return error;
struct rpki_uri *uri;
int error;
- error = uri_create_mixed_str(&uri, location, strlen(location));
+ /* rfc8181#section-2.2 must be an rsync URI */
+ error = uri_create_rsync_str(&uri, location, strlen(location));
if (error)
return error;
}
error = validate_uri_begin(PFX_HTTPS, PFX_HTTPS_LEN, global, global_len,
size, 0);
- if (error)
+ if (error) {
+ pr_warn("URI '%s' does not begin with '%s' nor '%s'.",
+ global, PFX_RSYNC, PFX_HTTPS);
return ENOTSUPPORTED;
+ }
/* @size was already set */
(*type) = URI_HTTPS;
return uri_create(uri, URI_VALID_HTTPS, guri, guri_len);
}
-/* A URI that can be rsync or https */
+/*
+ * A URI that can be rsync or https.
+ *
+ * Return ENOTSUPPORTED if not an rsync or https URI.
+ */
int
uri_create_mixed_str(struct rpki_uri **uri, char const *guri, size_t guri_len)
{
*/
if (type != GEN_URI) {
pr_err("Unknown GENERAL_NAME type: %d", type);
- return -ENOTSUPPORTED;
+ return ENOTSUPPORTED;
}
/*