KRECAPTCHA(3) OpenBSD Programmer's Manual KRECAPTCHA(3)

NAME

krecaptchareCAPTCHA library in C

LIBRARY

library “libkrecaptcha”

SYNOPSIS

#include <krecaptcha.h>

enum krecaptchae
krecaptcha(const char *privkey, const char *remote, const char *challenge, const char *response);

DESCRIPTION

The krecaptcha library securely interfaces with the reCAPTCHA service to verify the CAPTCHA solution response against a prior-obtained challenge for client IP address remote. You must have a valid reCAPTCHA key privkey. It uses libcurl(3) to perform the service communication. The function will block until all I/O is complete.

To link applications with krecaptcha, you'll need to include library “libkrecaptcha” and library “libcurl”.

You should make sure your privkey doesn't hang around: use explicit_bzero(3) or similar to securely nullify its contents.

RETURN VALUES

The krecaptcha() function returns a status enumeration:
KRECAPTCHA_OK
CAPTCHA has been verified
KRECAPTCHA_CURL_INIT
bad libcurl(3) initialisation
KRECAPTCHA_CURL_SETUP
bad libcurl(3) setup
KRECAPTCHA_CURL_PERFORM
libcurl(3) run-time error
KRECAPTCHA_RESPONSE
malformed reCAPTCHA response
KRECAPTCHA_PRIVKEY
bad reCAPTCHA private key
KRECAPTCHA_CHALLENGE
bad reCAPTCHA challenge
KRECAPTCHA_SOLUTION
bad reCAPTCHA solution
KRECAPTCHA_TIMEOUT
challenge is too old

SEE ALSO

reCAPTCHA, libcurl(3)

AUTHORS

The krecaptcha library was written by Kristaps Dzonsons <kristaps@bsd.lv>.
May 8, 2014 OpenBSD 5.0