From: Tollef Fog Heen Date: Mon, 12 Oct 2009 08:32:39 +0000 (+0200) Subject: Switch to ysc_b64_encode, get rid of glib dependency X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5a8c2b17c39fc62b83f582da699943e9ec92ca3;p=yubikey-server-c Switch to ysc_b64_encode, get rid of glib dependency --- diff --git a/src/main.c b/src/main.c index 765be2a..3cd883b 100644 --- a/src/main.c +++ b/src/main.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include "util.h" #include @@ -79,10 +78,10 @@ char *get_timestamp(void) { return ts; } -gchar *sign_request(char *key, size_t key_len, char *info, char *status, +char *sign_request(char *key, size_t key_len, char *info, char *status, char *timestamp) { char *line; - gchar *ret; + char *ret; gcry_md_hd_t hd; if (info != NULL) { asprintf(&line, "info=%s&status=%s×tamp=%s", info, @@ -94,7 +93,8 @@ gchar *sign_request(char *key, size_t key_len, char *info, char *status, gcry_md_setkey(hd, key, key_len); gcry_md_write(hd, line, strlen(line)); gcry_md_final(hd); - ret = g_base64_encode(gcry_md_read(hd, 0), gcry_md_get_algo_dlen(GCRY_MD_SHA1)); + ret = ysc_b64_encode((char *) gcry_md_read(hd, 0), + gcry_md_get_algo_dlen(GCRY_MD_SHA1)); gcry_md_close(hd); free(line); return ret;