#include <stdio.h>
#include <errno.h>
#include "cryptlib.h"
-#include "buffer.h"
-#include "bio.h"
-#include "evp.h"
-#include "rand.h"
+#include <openssl/buffer.h>
+#include <openssl/bio.h>
+#include <openssl/evp.h>
+#include <openssl/rand.h>
#ifndef NOPROTO
static int ok_write(BIO *h,char *buf,int num);
return(ret);
}
-static void longswap(char* ptr, int len)
+static void longswap(void *_ptr, int len)
{
#ifndef L_ENDIAN
int i;
+ char *ptr=_ptr;
for(i= 0;i < len;i+= 4){
*((unsigned long *)&(ptr[i]))= swapem(*((unsigned long *)&(ptr[i])));
longswap(&(ctx->buf[ctx->buf_len]), md->digest->md_size);
ctx->buf_len+= md->digest->md_size;
- EVP_DigestUpdate(md, WELLKNOWN, strlen(WELLKNOWN));
+ EVP_DigestUpdate(md, (unsigned char*)WELLKNOWN, strlen(WELLKNOWN));
md->digest->final(&(ctx->buf[ctx->buf_len]), &(md->md.base[0]));
ctx->buf_len+= md->digest->md_size;
ctx->blockout= 1;
longswap(&(md->md.base[0]), md->digest->md_size);
ctx->buf_off+= md->digest->md_size;
- EVP_DigestUpdate(md, WELLKNOWN, strlen(WELLKNOWN));
+ EVP_DigestUpdate(md, (unsigned char*)WELLKNOWN, strlen(WELLKNOWN));
md->digest->final(tmp, &(md->md.base[0]));
ret= memcmp(&(ctx->buf[ctx->buf_off]), tmp, md->digest->md_size) == 0;
ctx->buf_off+= md->digest->md_size;
tl= swapem(tl);
memcpy(ctx->buf, &tl, OK_BLOCK_BLOCK);
tl= swapem(tl);
- EVP_DigestUpdate(md, &(ctx->buf[OK_BLOCK_BLOCK]), tl);
+ EVP_DigestUpdate(md, (unsigned char*) &(ctx->buf[OK_BLOCK_BLOCK]), tl);
md->digest->final(&(ctx->buf[ctx->buf_len]), &(md->md.base[0]));
ctx->buf_len+= md->digest->md_size;
ctx->blockout= 1;
tl= swapem(tl);
if (ctx->buf_len < tl+ OK_BLOCK_BLOCK+ md->digest->md_size) return;
- EVP_DigestUpdate(md, &(ctx->buf[OK_BLOCK_BLOCK]), tl);
+ EVP_DigestUpdate(md, (unsigned char*) &(ctx->buf[OK_BLOCK_BLOCK]), tl);
md->digest->final(tmp, &(md->md.base[0]));
if(memcmp(&(ctx->buf[tl+ OK_BLOCK_BLOCK]), tmp, md->digest->md_size) == 0)
{