Coverage Report

Created: 2026-10-16 07:07

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl/crypto/asn1/a_octet.c
Line
Count
Source
1
/*
2
 * Copyright 1995-2026 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
#include <stdio.h>
11
#include "internal/cryptlib.h"
12
#include <openssl/asn1.h>
13
#include "crypto/asn1.h"
14
15
ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *x)
16
0
{
17
0
    return ASN1_STRING_dup(x);
18
0
}
19
20
int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a,
21
    const ASN1_OCTET_STRING *b)
22
0
{
23
0
    return ASN1_STRING_cmp(a, b);
24
0
}
25
26
int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, const unsigned char *d,
27
    int len)
28
0
{
29
0
    if (len < -1) {
30
0
        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
31
0
        return 0;
32
0
    }
33
0
    if (len == -1)
34
0
        return ossl_asn1_string_set1_string(x, (const char *)d);
35
0
    return ossl_asn1_string_set1_data(x, d, len);
36
0
}