Skip to content

Commit

Permalink
feat: changed API to simple enroll
Browse files Browse the repository at this point in the history
  • Loading branch information
mereacre committed Jan 15, 2024
1 parent dcd0a36 commit a4c70e5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
3 changes: 0 additions & 3 deletions src/brski/masa/masa_api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
#define PATH_BRSKI_REQUESTAUDITLOG BRSKI_PREFIX_PATH "/requestauditlog"
#define PATH_BRSKI_ENROLLSTATUS BRSKI_PREFIX_PATH "/enrollstatus"

/* Not part of the standard */
#define PATH_BRSKI_SIGNCERT BRSKI_PREFIX_PATH "/signcert"

#define EST_PREFIX_PATH "/.well-known/est"
#define PATH_EST_CACERTS EST_PREFIX_PATH "/cacerts"
#define PATH_EST_SIMPLEENROLL EST_PREFIX_PATH "/simpleenroll"
Expand Down
2 changes: 1 addition & 1 deletion src/brski/pledge/pledge_request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ int post_sign_cert(struct pledge_config *pconf, struct registrar_config *rconf,
struct BinaryArray pinned_domain_cert = {};
int status;
char *pki_str = NULL;
std::string path = PATH_BRSKI_SIGNCERT;
std::string path = PATH_EST_SIMPLEENROLL;
std::string content_type = "application/voucher-cms+json";
std::string registrar_ca_cert;
ssize_t length;
Expand Down
4 changes: 2 additions & 2 deletions src/brski/registrar/registrar_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ int registrar_enrollstatus(const RequestHeader &request_header,
return 200;
}

int registrar_signcert(const RequestHeader &request_header,
int registrar_est_simpleenroll(const RequestHeader &request_header,
const std::string &request_body,
CRYPTO_CERT peer_certificate,
ResponseHeader &response_header, std::string &response,
Expand All @@ -319,7 +319,7 @@ int registrar_signcert(const RequestHeader &request_header,
struct BinaryArray *tls_ca_cert = NULL;
ssize_t length;

log_trace("registrar_signcert:");
log_trace("registrar_est_simpleenroll:");

char *cert_str = (char *)request_body.c_str();

Expand Down
2 changes: 1 addition & 1 deletion src/brski/registrar/registrar_api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ int registrar_enrollstatus(const RequestHeader &request_header,
* @retval 500 Internal Server Error.
* @retval 502 Bad Gateway
*/
int registrar_signcert(const RequestHeader &request_header,
int registrar_est_simpleenroll(const RequestHeader &request_header,
const std::string &request_body,
CRYPTO_CERT peer_certificate,
ResponseHeader &response_header, std::string &response,
Expand Down
4 changes: 2 additions & 2 deletions src/brski/registrar/registrar_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ void setup_registrar_routes(std::vector<struct RouteTuple> &routes) {
.method = HTTP_METHOD_POST,
.handle = registrar_enrollstatus});

routes.push_back({.path = std::string(PATH_BRSKI_SIGNCERT),
routes.push_back({.path = std::string(PATH_EST_SIMPLEENROLL),
.method = HTTP_METHOD_POST,
.handle = registrar_signcert});
.handle = registrar_est_simpleenroll});
}

int registrar_start(struct registrar_config *rconf, struct masa_config *mconf,
Expand Down

0 comments on commit a4c70e5

Please sign in to comment.