Coverage Report

Created: 2025-08-28 06:59

/src/boringssl/crypto/x509/x_sig.cc
Line
Count
Source (jump to first uncovered line)
1
// Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
//     https://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#include <stdio.h>
16
17
#include <openssl/asn1t.h>
18
#include <openssl/x509.h>
19
20
21
struct X509_sig_st {
22
  X509_ALGOR *algor;
23
  ASN1_OCTET_STRING *digest;
24
} /* X509_SIG */;
25
26
ASN1_SEQUENCE(X509_SIG) = {
27
    ASN1_SIMPLE(X509_SIG, algor, X509_ALGOR),
28
    ASN1_SIMPLE(X509_SIG, digest, ASN1_OCTET_STRING),
29
} ASN1_SEQUENCE_END(X509_SIG)
30
31
IMPLEMENT_ASN1_FUNCTIONS_const(X509_SIG)
32
33
void X509_SIG_get0(const X509_SIG *sig, const X509_ALGOR **out_alg,
34
0
                   const ASN1_OCTET_STRING **out_digest) {
35
0
  if (out_alg != NULL) {
36
0
    *out_alg = sig->algor;
37
0
  }
38
0
  if (out_digest != NULL) {
39
0
    *out_digest = sig->digest;
40
0
  }
41
0
}
42
43
void X509_SIG_getm(X509_SIG *sig, X509_ALGOR **out_alg,
44
0
                   ASN1_OCTET_STRING **out_digest) {
45
0
  if (out_alg != NULL) {
46
0
    *out_alg = sig->algor;
47
0
  }
48
0
  if (out_digest != NULL) {
49
0
    *out_digest = sig->digest;
50
0
  }
51
0
}