md5 in inline C
dwi kristianto
steamboatid at gmail.com
Wed Jan 5 15:19:48 CET 2011
hello all,
is there any easy way to use md5 with varnish VCL inline C?'
i've tried this code with no luck.
at sub vcl_recv:
#include <openssl/ssl.h>
#include <openssl/ssl3.h>
void md5_hashing(char *msg, char *md5hash){
EVP_MD_CTX mdctx;
const EVP_MD *md;
unsigned char md_value[EVP_MAX_MD_SIZE];
int md_len, i;
EVP_MD_CTX_init(&mdctx);
EVP_DigestInit_ex(&mdctx, md, NULL);
EVP_DigestUpdate(&mdctx, msg, strlen(msg));
EVP_DigestFinal_ex(&mdctx, md5hash, &md_len);
EVP_MD_CTX_cleanup(&mdctx);
}
taken from /etc/init.d/varnish
start_varnishd() {
log_daemon_msg "Starting $DESC" "$NAME"
output=$(/bin/tempfile -s.varnish)
if start-stop-daemon \
--start --quiet --pidfile ${PIDFILE} --exec ${DAEMON} -- \
-P ${PIDFILE} ${DAEMON_OPTS} \
-p cc_command='cc -fpic -shared -Wl,-x --verbose \
-L/usr/local/include/libmemcached/memcached.h -lmemcached \
-L/usr/local/include/openssl/ssl3.h -lssl \
-o %o %s' > ${output} 2>&1; then
log_end_msg 0
else
log_end_msg 1
cat $output
exit 1
fi
rm $output
}
many thanks in advance for any responses.
regards,
dwi
More information about the varnish-misc
mailing list