VirtualBox

source: vbox/trunk/src/libs/openssl-3.4.1/apps/lib/names.c@ 109302

Last change on this file since 109302 was 109052, checked in by vboxsync, 4 weeks ago

openssl-3.4.1: Applied our changes, regenerated files, added missing files and functions. This time with a three way merge. ​bugref:10890

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.1 KB
Line 
1/*
2 * Copyright 2019-2022 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 <string.h>
11#include <openssl/bio.h>
12#include <openssl/safestack.h>
13#include "names.h"
14#include "internal/e_os.h"
15
16int name_cmp(const char * const *a, const char * const *b)
17{
18 return OPENSSL_strcasecmp(*a, *b);
19}
20
21void collect_names(const char *name, void *vdata)
22{
23 STACK_OF(OPENSSL_CSTRING) *names = vdata;
24
25 sk_OPENSSL_CSTRING_push(names, name);
26}
27
28void print_names(BIO *out, STACK_OF(OPENSSL_CSTRING) *names)
29{
30 int i = sk_OPENSSL_CSTRING_num(names);
31 int j;
32
33 sk_OPENSSL_CSTRING_sort(names);
34 if (i > 1)
35 BIO_printf(out, "{ ");
36 for (j = 0; j < i; j++) {
37 const char *name = sk_OPENSSL_CSTRING_value(names, j);
38
39 if (j > 0)
40 BIO_printf(out, ", ");
41 BIO_printf(out, "%s", name);
42 }
43 if (i > 1)
44 BIO_printf(out, " }");
45}
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette