VirtualBox

source: vbox/trunk/src/libs/openssl-3.0.1/crypto/asn1/n_pkey.c@ 94082

Last change on this file since 94082 was 94082, checked in by vboxsync, 3 years ago

libs/openssl-3.0.1: started applying and adjusting our OpenSSL changes to 3.0.1. bugref:10128

File size: 2.0 KB
Line 
1/*
2 * Copyright 1995-2021 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 <openssl/opensslconf.h>
11#include "internal/cryptlib.h"
12#include <stdio.h>
13#include <openssl/rsa.h>
14#include <openssl/objects.h>
15#include <openssl/asn1t.h>
16#include <openssl/evp.h>
17#include <openssl/x509.h>
18
19#define ASN1_BROKEN_SEQUENCE(tname) \
20 static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0, 0}; \
21 ASN1_SEQUENCE(tname)
22#define static_ASN1_BROKEN_SEQUENCE_END(stname) \
23 static_ASN1_SEQUENCE_END_ref(stname, stname)
24
25typedef struct netscape_pkey_st {
26 int32_t version;
27 X509_ALGOR *algor;
28 ASN1_OCTET_STRING *private_key;
29} NETSCAPE_PKEY;
30
31typedef struct netscape_encrypted_pkey_st {
32 ASN1_OCTET_STRING *os;
33 /*
34 * This is the same structure as DigestInfo so use it: although this
35 * isn't really anything to do with digests.
36 */
37 X509_SIG *enckey;
38} NETSCAPE_ENCRYPTED_PKEY;
39
40
41ASN1_BROKEN_SEQUENCE(NETSCAPE_ENCRYPTED_PKEY) = {
42 ASN1_SIMPLE(NETSCAPE_ENCRYPTED_PKEY, os, ASN1_OCTET_STRING),
43 ASN1_SIMPLE(NETSCAPE_ENCRYPTED_PKEY, enckey, X509_SIG)
44} static_ASN1_BROKEN_SEQUENCE_END(NETSCAPE_ENCRYPTED_PKEY)
45
46DECLARE_ASN1_FUNCTIONS(NETSCAPE_ENCRYPTED_PKEY)
47DECLARE_ASN1_ENCODE_FUNCTIONS_name(NETSCAPE_ENCRYPTED_PKEY, NETSCAPE_ENCRYPTED_PKEY)
48IMPLEMENT_ASN1_FUNCTIONS(NETSCAPE_ENCRYPTED_PKEY)
49
50ASN1_SEQUENCE(NETSCAPE_PKEY) = {
51 ASN1_EMBED(NETSCAPE_PKEY, version, INT32),
52 ASN1_SIMPLE(NETSCAPE_PKEY, algor, X509_ALGOR),
53 ASN1_SIMPLE(NETSCAPE_PKEY, private_key, ASN1_OCTET_STRING)
54} static_ASN1_SEQUENCE_END(NETSCAPE_PKEY)
55
56DECLARE_ASN1_FUNCTIONS(NETSCAPE_PKEY)
57DECLARE_ASN1_ENCODE_FUNCTIONS_name(NETSCAPE_PKEY, NETSCAPE_PKEY)
58IMPLEMENT_ASN1_FUNCTIONS(NETSCAPE_PKEY)
Note: See TracBrowser for help on using the repository browser.

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