]> wagner.pp.ru Git - openssl-gost/engine.git/blob - gost_asn1.c
Error codes rebuild
[openssl-gost/engine.git] / gost_asn1.c
1 /**********************************************************************
2  *                          gost_keytrans.c                           *
3  *             Copyright (c) 2005-2006 Cryptocom LTD                  *
4  *         This file is distributed under the same license as OpenSSL *
5  *                                                                    *
6  *   ASN1 structure definition for GOST key transport                 *
7  *          Requires OpenSSL 0.9.9 for compilation                    *
8  **********************************************************************/
9 #include <stdio.h>
10 #include <openssl/asn1t.h>
11 #include <openssl/x509.h>
12 #include "gost_lcl.h"
13
14 ASN1_NDEF_SEQUENCE(GOST_KEY_TRANSPORT) = {
15     ASN1_SIMPLE(GOST_KEY_TRANSPORT, key_info, GOST_KEY_INFO),
16     ASN1_IMP(GOST_KEY_TRANSPORT, key_agreement_info,
17              GOST_KEY_AGREEMENT_INFO, 0)
18 }
19 ASN1_NDEF_SEQUENCE_END(GOST_KEY_TRANSPORT)
20 IMPLEMENT_ASN1_FUNCTIONS(GOST_KEY_TRANSPORT)
21
22 ASN1_NDEF_SEQUENCE(GOST_KEY_INFO) =
23 {
24     ASN1_SIMPLE(GOST_KEY_INFO, encrypted_key, ASN1_OCTET_STRING),
25         ASN1_SIMPLE(GOST_KEY_INFO, imit, ASN1_OCTET_STRING)
26 } ASN1_NDEF_SEQUENCE_END(GOST_KEY_INFO)
27 IMPLEMENT_ASN1_FUNCTIONS(GOST_KEY_INFO)
28 ASN1_NDEF_SEQUENCE(GOST_KEY_AGREEMENT_INFO) =
29 {
30     ASN1_SIMPLE(GOST_KEY_AGREEMENT_INFO, cipher, ASN1_OBJECT),
31         ASN1_IMP_OPT(GOST_KEY_AGREEMENT_INFO, ephem_key, X509_PUBKEY, 0),
32         ASN1_SIMPLE(GOST_KEY_AGREEMENT_INFO, eph_iv, ASN1_OCTET_STRING)
33 } ASN1_NDEF_SEQUENCE_END(GOST_KEY_AGREEMENT_INFO)
34 IMPLEMENT_ASN1_FUNCTIONS(GOST_KEY_AGREEMENT_INFO)
35 ASN1_NDEF_SEQUENCE(GOST_KEY_PARAMS) =
36 {
37 ASN1_SIMPLE(GOST_KEY_PARAMS, key_params, ASN1_OBJECT),
38         ASN1_SIMPLE(GOST_KEY_PARAMS, hash_params, ASN1_OBJECT),
39         ASN1_OPT(GOST_KEY_PARAMS, cipher_params,
40                      ASN1_OBJECT),} ASN1_NDEF_SEQUENCE_END(GOST_KEY_PARAMS)
41 IMPLEMENT_ASN1_FUNCTIONS(GOST_KEY_PARAMS)
42 ASN1_NDEF_SEQUENCE(GOST_CIPHER_PARAMS) =
43 {
44     ASN1_SIMPLE(GOST_CIPHER_PARAMS, iv, ASN1_OCTET_STRING),
45     ASN1_SIMPLE(GOST_CIPHER_PARAMS, enc_param_set, ASN1_OBJECT),
46 }
47 ASN1_NDEF_SEQUENCE_END(GOST_CIPHER_PARAMS)
48 IMPLEMENT_ASN1_FUNCTIONS(GOST_CIPHER_PARAMS)
49 ASN1_NDEF_SEQUENCE(GOST_CLIENT_KEY_EXCHANGE_PARAMS) =
50 {                               /* FIXME incomplete */
51     ASN1_SIMPLE(GOST_CLIENT_KEY_EXCHANGE_PARAMS, gkt, GOST_KEY_TRANSPORT)
52 }
53 ASN1_NDEF_SEQUENCE_END(GOST_CLIENT_KEY_EXCHANGE_PARAMS)
54 IMPLEMENT_ASN1_FUNCTIONS(GOST_CLIENT_KEY_EXCHANGE_PARAMS)
55
56 ASN1_NDEF_SEQUENCE(MASKED_GOST_KEY) =
57 {
58     ASN1_SIMPLE(MASKED_GOST_KEY, masked_priv_key, ASN1_OCTET_STRING),
59         ASN1_SIMPLE(MASKED_GOST_KEY, public_key, ASN1_OCTET_STRING)
60 } ASN1_NDEF_SEQUENCE_END(MASKED_GOST_KEY)
61 IMPLEMENT_ASN1_FUNCTIONS(MASKED_GOST_KEY)