From 306cf74eb0101a12b51549866a4d60296618ee0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Wed, 14 Sep 2022 18:19:14 +0800 Subject: OAuth part The minimum to pass all authentications and arrive at the embedded app index. This library is to be used with shopify-app-template-c for now, as it assumes the existence of shopify.app.toml in the parent directory, and index.html in the frontend directory. --- base64.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 base64.h (limited to 'base64.h') diff --git a/base64.h b/base64.h new file mode 100644 index 0000000..8533af1 --- /dev/null +++ b/base64.h @@ -0,0 +1,13 @@ +#include + +static inline void base64_decode(unsigned char *host, char **decoded_host) +{ + gnutls_datum_t result; + gnutls_base64_decode2(&(gnutls_datum_t){ + host, + strlen((const char *)host) + }, &result); + *decoded_host = malloc(result.size + 1); + strlcpy(*decoded_host, (const char *)result.data, result.size + 1); + gnutls_free(result.data); +} -- cgit v1.2.3