Coverage Report

Created: 2025-04-22 06:18

/src/openssl/crypto/mdc2/mdc2_one.c
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
3
 *
4
 * Licensed under the Apache License 2.0 (the "License").  You may not use
5
 * this file except in compliance with the License.  You can obtain a copy
6
 * in the file LICENSE in the source distribution or at
7
 * https://www.openssl.org/source/license.html
8
 */
9
10
/*
11
 * MD2 low level APIs are deprecated for public use, but still ok for
12
 * internal use.
13
 */
14
#include "internal/deprecated.h"
15
16
#include <stdio.h>
17
#include "internal/cryptlib.h"
18
#include <openssl/mdc2.h>
19
20
unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md)
21
0
{
22
0
    MDC2_CTX c;
23
0
    static unsigned char m[MDC2_DIGEST_LENGTH];
24
25
0
    if (md == NULL)
26
0
        md = m;
27
0
    if (!MDC2_Init(&c))
28
0
        return NULL;
29
0
    MDC2_Update(&c, d, n);
30
0
    MDC2_Final(md, &c);
31
0
    OPENSSL_cleanse(&c, sizeof(c)); /* security consideration */
32
0
    return md;
33
0
}