Latest update.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
#include <openssl/crypto.h>
|
||||
#include "internal/blake2.h"
|
||||
#include "internal/core_mkdigest.h"
|
||||
#include "internal/digestcommon.h"
|
||||
#include "internal/provider_algs.h"
|
||||
|
||||
OSSL_OP_digest_init_fn blake2s256_init;
|
||||
@@ -31,10 +31,12 @@ int blake2b512_init(void *ctx)
|
||||
return blake2b_init((BLAKE2B_CTX *)ctx, &P);
|
||||
}
|
||||
|
||||
OSSL_FUNC_DIGEST_CONSTRUCT(blake2s256, BLAKE2S_CTX,
|
||||
BLAKE2S_BLOCKBYTES, BLAKE2S_DIGEST_LENGTH,
|
||||
/* blake2s256_functions */
|
||||
IMPLEMENT_digest_functions(blake2s256, BLAKE2S_CTX,
|
||||
BLAKE2S_BLOCKBYTES, BLAKE2S_DIGEST_LENGTH, 0,
|
||||
blake2s256_init, blake2s_update, blake2s_final)
|
||||
|
||||
OSSL_FUNC_DIGEST_CONSTRUCT(blake2b512, BLAKE2B_CTX,
|
||||
BLAKE2B_BLOCKBYTES, BLAKE2B_DIGEST_LENGTH,
|
||||
/* blake2b512_functions */
|
||||
IMPLEMENT_digest_functions(blake2b512, BLAKE2B_CTX,
|
||||
BLAKE2B_BLOCKBYTES, BLAKE2B_DIGEST_LENGTH, 0,
|
||||
blake2b512_init, blake2b_update, blake2b_final)
|
||||
@@ -18,7 +18,6 @@
|
||||
#include <string.h>
|
||||
#include <openssl/crypto.h>
|
||||
#include "blake2_impl.h"
|
||||
|
||||
#include "internal/blake2.h"
|
||||
|
||||
static const uint64_t blake2b_IV[8] =
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
SOURCE[../../../libcrypto]=\
|
||||
null_prov.c
|
||||
|
||||
IF[{- !$disabled{blake2} -}]
|
||||
SOURCE[../../../libcrypto]=\
|
||||
|
||||
@@ -9,9 +9,10 @@
|
||||
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/md5.h>
|
||||
#include "internal/core_mkdigest.h"
|
||||
#include "internal/digestcommon.h"
|
||||
#include "internal/provider_algs.h"
|
||||
|
||||
OSSL_FUNC_DIGEST_CONSTRUCT(md5, MD5_CTX,
|
||||
MD5_CBLOCK, MD5_DIGEST_LENGTH,
|
||||
/* md5_functions */
|
||||
IMPLEMENT_digest_functions(md5, MD5_CTX,
|
||||
MD5_CBLOCK, MD5_DIGEST_LENGTH, 0,
|
||||
MD5_Init, MD5_Update, MD5_Final)
|
||||
@@ -7,20 +7,30 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/params.h>
|
||||
#include <openssl/core_names.h>
|
||||
#include "internal/core_mkdigest.h"
|
||||
#include "internal/md5_sha1.h"
|
||||
#include "internal/digestcommon.h"
|
||||
#include "internal/provider_algs.h"
|
||||
|
||||
static OSSL_OP_digest_set_params_fn md5_sha1_set_params;
|
||||
static OSSL_OP_digest_set_ctx_params_fn md5_sha1_set_ctx_params;
|
||||
static OSSL_OP_digest_settable_ctx_params_fn md5_sha1_settable_ctx_params;
|
||||
|
||||
static const OSSL_PARAM known_md5_sha1_settable_ctx_params[] = {
|
||||
{OSSL_DIGEST_PARAM_SSL3_MS, OSSL_PARAM_OCTET_STRING, NULL, 0, 0},
|
||||
OSSL_PARAM_END
|
||||
};
|
||||
|
||||
static const OSSL_PARAM *md5_sha1_settable_ctx_params(void)
|
||||
{
|
||||
return known_md5_sha1_settable_ctx_params;
|
||||
}
|
||||
|
||||
/* Special set_params method for SSL3 */
|
||||
static int md5_sha1_set_params(void *vctx, const OSSL_PARAM params[])
|
||||
static int md5_sha1_set_ctx_params(void *vctx, const OSSL_PARAM params[])
|
||||
{
|
||||
const OSSL_PARAM *p;
|
||||
MD5_SHA1_CTX *ctx = (MD5_SHA1_CTX *)vctx;
|
||||
@@ -34,7 +44,8 @@ static int md5_sha1_set_params(void *vctx, const OSSL_PARAM params[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
OSSL_FUNC_DIGEST_CONSTRUCT_PARAMS(md5_sha1, MD5_SHA1_CTX,
|
||||
MD5_SHA1_CBLOCK, MD5_SHA1_DIGEST_LENGTH,
|
||||
md5_sha1_init, md5_sha1_update, md5_sha1_final,
|
||||
md5_sha1_set_params)
|
||||
/* md5_sha1_functions */
|
||||
IMPLEMENT_digest_functions_with_settable_ctx(
|
||||
md5_sha1, MD5_SHA1_CTX, MD5_SHA1_CBLOCK, MD5_SHA1_DIGEST_LENGTH, 0,
|
||||
md5_sha1_init, md5_sha1_update, md5_sha1_final,
|
||||
md5_sha1_settable_ctx_params, md5_sha1_set_ctx_params)
|
||||
@@ -1,75 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#include <openssl/core_numbers.h>
|
||||
#include <openssl/whrlpool.h>
|
||||
#include "internal/provider_algs.h"
|
||||
|
||||
static int nullmd_dummy = 1;
|
||||
|
||||
static OSSL_OP_digest_init_fn nullmd_init;
|
||||
static OSSL_OP_digest_update_fn nullmd_update;
|
||||
static OSSL_OP_digest_final_fn nullmd_final;
|
||||
static OSSL_OP_digest_newctx_fn nullmd_newctx;
|
||||
static OSSL_OP_digest_freectx_fn nullmd_freectx;
|
||||
static OSSL_OP_digest_dupctx_fn nullmd_dupctx;
|
||||
static OSSL_OP_digest_size_fn nullmd_size;
|
||||
static OSSL_OP_digest_block_size_fn nullmd_block_size;
|
||||
|
||||
static size_t nullmd_block_size(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static size_t nullmd_size(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int nullmd_init(void *vctx)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int nullmd_update(void *vctx, const unsigned char *inp, size_t bytes)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int nullmd_final(void *ctx, unsigned char *out, size_t *outl, size_t outsz)
|
||||
{
|
||||
*outl = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void *nullmd_newctx(void *prov_ctx)
|
||||
{
|
||||
return &nullmd_dummy;
|
||||
}
|
||||
|
||||
static void nullmd_freectx(void *vctx)
|
||||
{
|
||||
}
|
||||
|
||||
static void *nullmd_dupctx(void *ctx)
|
||||
{
|
||||
return &nullmd_dummy;
|
||||
}
|
||||
|
||||
const OSSL_DISPATCH nullmd_functions[] = {
|
||||
{ OSSL_FUNC_DIGEST_NEWCTX, (void (*)(void))nullmd_newctx },
|
||||
{ OSSL_FUNC_DIGEST_INIT, (void (*)(void))nullmd_init },
|
||||
{ OSSL_FUNC_DIGEST_UPDATE, (void (*)(void))nullmd_update },
|
||||
{ OSSL_FUNC_DIGEST_FINAL, (void (*)(void))nullmd_final },
|
||||
{ OSSL_FUNC_DIGEST_FREECTX, (void (*)(void))nullmd_freectx },
|
||||
{ OSSL_FUNC_DIGEST_DUPCTX, (void (*)(void))nullmd_dupctx },
|
||||
{ OSSL_FUNC_DIGEST_SIZE, (void (*)(void))nullmd_size },
|
||||
{ OSSL_FUNC_DIGEST_BLOCK_SIZE, (void (*)(void))nullmd_block_size },
|
||||
{ 0, NULL }
|
||||
};
|
||||
@@ -9,9 +9,10 @@
|
||||
|
||||
#include <openssl/crypto.h>
|
||||
#include "internal/sm3.h"
|
||||
#include "internal/core_mkdigest.h"
|
||||
#include "internal/digestcommon.h"
|
||||
#include "internal/provider_algs.h"
|
||||
|
||||
OSSL_FUNC_DIGEST_CONSTRUCT(sm3, SM3_CTX,
|
||||
SM3_CBLOCK, SM3_DIGEST_LENGTH,
|
||||
/* sm3_functions */
|
||||
IMPLEMENT_digest_functions(sm3, SM3_CTX,
|
||||
SM3_CBLOCK, SM3_DIGEST_LENGTH, 0,
|
||||
sm3_init, sm3_update, sm3_final)
|
||||
Reference in New Issue
Block a user