Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <string.h>
00025 #include <openssl/sha.h>
00026 #include <openssl/md5.h>
00027 #include "rfbcrypto.h"
00028
00029 void digestmd5(const struct iovec *iov, int iovcnt, void *dest)
00030 {
00031 MD5_CTX c;
00032 int i;
00033
00034 MD5_Init(&c);
00035 for (i = 0; i < iovcnt; i++)
00036 MD5_Update(&c, iov[i].iov_base, iov[i].iov_len);
00037 MD5_Final(dest, &c);
00038 }
00039
00040 void digestsha1(const struct iovec *iov, int iovcnt, void *dest)
00041 {
00042 SHA_CTX c;
00043 int i;
00044
00045 SHA1_Init(&c);
00046 for (i = 0; i < iovcnt; i++)
00047 SHA1_Update(&c, iov[i].iov_base, iov[i].iov_len);
00048 SHA1_Final(dest, &c);
00049 }