aboutsummaryrefslogtreecommitdiffstats
path: root/facebook/facebook-util.h
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2017-10-24 21:10:02 +0200
committerMarius Halden <marius.h@lden.org>2017-10-24 21:10:02 +0200
commit7d3a199e5084831fe08aae7e67f562d9fb3fa07b (patch)
treec2d1eb73ef18d89c0207b4c3629ac859cf39e191 /facebook/facebook-util.h
parentf5a6c8e103d06d949c6ef292cbfc0af2a6fe42e0 (diff)
parent553593d07170d6d1563d0079dbedd481dcec5b00 (diff)
downloadbitlbee-facebook-track-messages.tar.gz
bitlbee-facebook-track-messages.tar.bz2
bitlbee-facebook-track-messages.tar.xz
Merge branch 'master' into track-messagestrack-messages
Diffstat (limited to 'facebook/facebook-util.h')
-rw-r--r--facebook/facebook-util.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/facebook/facebook-util.h b/facebook/facebook-util.h
index a595cf3..b080eb4 100644
--- a/facebook/facebook-util.h
+++ b/facebook/facebook-util.h
@@ -289,4 +289,30 @@ fb_util_zlib_deflate(const GByteArray *bytes, GError **error);
GByteArray *
fb_util_zlib_inflate(const GByteArray *bytes, GError **error);
+/**
+ * fb_util_urlsafe_base64_encode:
+ * @data: the binary data to encode.
+ * @len: the length of data
+ *
+ * Wrapper around g_base64_encode() which substitutes '-' instead of '+'
+ * and '_' instead of '/' and removes the padding
+ *
+ * Returns: A newly allocated string.
+ */
+
+gchar *
+fb_util_urlsafe_base64_encode(const guchar *data, gsize len);
+
+/**
+ * fb_util_gen_sso_verifier:
+ * @challenge: base64 of sha256 of verifier
+ * @verifier: base64 of random data
+ * @req_id: base64 of random data
+ *
+ * Generates the challenge/response parameters used for the workchat SSO auth.
+ * All parameters are output parameters.
+ */
+void
+fb_util_gen_sso_verifier(gchar **challenge, gchar **verifier, gchar **req_id);
+
#endif /* _FACEBOOK_UTIL_H_ */