Home | History | Annotate | Line # | Download | only in prov
      1 /*
      2  * WARNING: do not edit!
      3  * Generated by Makefile from providers/common/include/prov/der_rsa.h.in
      4  *
      5  * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
      6  *
      7  * Licensed under the Apache License 2.0 (the "License").  You may not use
      8  * this file except in compliance with the License.  You can obtain a copy
      9  * in the file LICENSE in the source distribution or at
     10  * https://www.openssl.org/source/license.html
     11  */
     12 
     13 #include "crypto/rsa.h"
     14 #include "internal/der.h"
     15 
     16 /* Well known OIDs precompiled */
     17 
     18 /*
     19  * hashAlgs OBJECT IDENTIFIER ::= { nistAlgorithms 2 }
     20  */
     21 #define DER_OID_V_hashAlgs DER_P_OBJECT, 8, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02
     22 #define DER_OID_SZ_hashAlgs 10
     23 extern const unsigned char ossl_der_oid_hashAlgs[DER_OID_SZ_hashAlgs];
     24 
     25 /*
     26  * rsaEncryption    OBJECT IDENTIFIER ::= { pkcs-1 1 }
     27  */
     28 #define DER_OID_V_rsaEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01
     29 #define DER_OID_SZ_rsaEncryption 11
     30 extern const unsigned char ossl_der_oid_rsaEncryption[DER_OID_SZ_rsaEncryption];
     31 
     32 /*
     33  * id-RSAES-OAEP    OBJECT IDENTIFIER ::= { pkcs-1 7 }
     34  */
     35 #define DER_OID_V_id_RSAES_OAEP DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x07
     36 #define DER_OID_SZ_id_RSAES_OAEP 11
     37 extern const unsigned char ossl_der_oid_id_RSAES_OAEP[DER_OID_SZ_id_RSAES_OAEP];
     38 
     39 /*
     40  * id-pSpecified    OBJECT IDENTIFIER ::= { pkcs-1 9 }
     41  */
     42 #define DER_OID_V_id_pSpecified DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x09
     43 #define DER_OID_SZ_id_pSpecified 11
     44 extern const unsigned char ossl_der_oid_id_pSpecified[DER_OID_SZ_id_pSpecified];
     45 
     46 /*
     47  * id-RSASSA-PSS    OBJECT IDENTIFIER ::= { pkcs-1 10 }
     48  */
     49 #define DER_OID_V_id_RSASSA_PSS DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0A
     50 #define DER_OID_SZ_id_RSASSA_PSS 11
     51 extern const unsigned char ossl_der_oid_id_RSASSA_PSS[DER_OID_SZ_id_RSASSA_PSS];
     52 
     53 /*
     54  * md2WithRSAEncryption         OBJECT IDENTIFIER ::= { pkcs-1 2 }
     55  */
     56 #define DER_OID_V_md2WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x02
     57 #define DER_OID_SZ_md2WithRSAEncryption 11
     58 extern const unsigned char ossl_der_oid_md2WithRSAEncryption[DER_OID_SZ_md2WithRSAEncryption];
     59 
     60 /*
     61  * md5WithRSAEncryption         OBJECT IDENTIFIER ::= { pkcs-1 4 }
     62  */
     63 #define DER_OID_V_md5WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x04
     64 #define DER_OID_SZ_md5WithRSAEncryption 11
     65 extern const unsigned char ossl_der_oid_md5WithRSAEncryption[DER_OID_SZ_md5WithRSAEncryption];
     66 
     67 /*
     68  * sha1WithRSAEncryption        OBJECT IDENTIFIER ::= { pkcs-1 5 }
     69  */
     70 #define DER_OID_V_sha1WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x05
     71 #define DER_OID_SZ_sha1WithRSAEncryption 11
     72 extern const unsigned char ossl_der_oid_sha1WithRSAEncryption[DER_OID_SZ_sha1WithRSAEncryption];
     73 
     74 /*
     75  * sha224WithRSAEncryption      OBJECT IDENTIFIER ::= { pkcs-1 14 }
     76  */
     77 #define DER_OID_V_sha224WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0E
     78 #define DER_OID_SZ_sha224WithRSAEncryption 11
     79 extern const unsigned char ossl_der_oid_sha224WithRSAEncryption[DER_OID_SZ_sha224WithRSAEncryption];
     80 
     81 /*
     82  * sha256WithRSAEncryption      OBJECT IDENTIFIER ::= { pkcs-1 11 }
     83  */
     84 #define DER_OID_V_sha256WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B
     85 #define DER_OID_SZ_sha256WithRSAEncryption 11
     86 extern const unsigned char ossl_der_oid_sha256WithRSAEncryption[DER_OID_SZ_sha256WithRSAEncryption];
     87 
     88 /*
     89  * sha384WithRSAEncryption      OBJECT IDENTIFIER ::= { pkcs-1 12 }
     90  */
     91 #define DER_OID_V_sha384WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0C
     92 #define DER_OID_SZ_sha384WithRSAEncryption 11
     93 extern const unsigned char ossl_der_oid_sha384WithRSAEncryption[DER_OID_SZ_sha384WithRSAEncryption];
     94 
     95 /*
     96  * sha512WithRSAEncryption      OBJECT IDENTIFIER ::= { pkcs-1 13 }
     97  */
     98 #define DER_OID_V_sha512WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0D
     99 #define DER_OID_SZ_sha512WithRSAEncryption 11
    100 extern const unsigned char ossl_der_oid_sha512WithRSAEncryption[DER_OID_SZ_sha512WithRSAEncryption];
    101 
    102 /*
    103  * sha512-224WithRSAEncryption  OBJECT IDENTIFIER ::= { pkcs-1 15 }
    104  */
    105 #define DER_OID_V_sha512_224WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0F
    106 #define DER_OID_SZ_sha512_224WithRSAEncryption 11
    107 extern const unsigned char ossl_der_oid_sha512_224WithRSAEncryption[DER_OID_SZ_sha512_224WithRSAEncryption];
    108 
    109 /*
    110  * sha512-256WithRSAEncryption  OBJECT IDENTIFIER ::= { pkcs-1 16 }
    111  */
    112 #define DER_OID_V_sha512_256WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x10
    113 #define DER_OID_SZ_sha512_256WithRSAEncryption 11
    114 extern const unsigned char ossl_der_oid_sha512_256WithRSAEncryption[DER_OID_SZ_sha512_256WithRSAEncryption];
    115 
    116 /*
    117  * id-mgf1    OBJECT IDENTIFIER ::= { pkcs-1 8 }
    118  */
    119 #define DER_OID_V_id_mgf1 DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x08
    120 #define DER_OID_SZ_id_mgf1 11
    121 extern const unsigned char ossl_der_oid_id_mgf1[DER_OID_SZ_id_mgf1];
    122 
    123 /*
    124  * id-rsassa-pkcs1-v1_5-with-sha3-224 OBJECT IDENTIFIER ::= { sigAlgs 13 }
    125  */
    126 #define DER_OID_V_id_rsassa_pkcs1_v1_5_with_sha3_224 DER_P_OBJECT, 9, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0D
    127 #define DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_224 11
    128 extern const unsigned char ossl_der_oid_id_rsassa_pkcs1_v1_5_with_sha3_224[DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_224];
    129 
    130 /*
    131  * id-rsassa-pkcs1-v1_5-with-sha3-256 OBJECT IDENTIFIER ::= { sigAlgs 14 }
    132  */
    133 #define DER_OID_V_id_rsassa_pkcs1_v1_5_with_sha3_256 DER_P_OBJECT, 9, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0E
    134 #define DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_256 11
    135 extern const unsigned char ossl_der_oid_id_rsassa_pkcs1_v1_5_with_sha3_256[DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_256];
    136 
    137 /*
    138  * id-rsassa-pkcs1-v1_5-with-sha3-384 OBJECT IDENTIFIER ::= { sigAlgs 15 }
    139  */
    140 #define DER_OID_V_id_rsassa_pkcs1_v1_5_with_sha3_384 DER_P_OBJECT, 9, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0F
    141 #define DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_384 11
    142 extern const unsigned char ossl_der_oid_id_rsassa_pkcs1_v1_5_with_sha3_384[DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_384];
    143 
    144 /*
    145  * id-rsassa-pkcs1-v1_5-with-sha3-512 OBJECT IDENTIFIER ::= { sigAlgs 16 }
    146  */
    147 #define DER_OID_V_id_rsassa_pkcs1_v1_5_with_sha3_512 DER_P_OBJECT, 9, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x10
    148 #define DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_512 11
    149 extern const unsigned char ossl_der_oid_id_rsassa_pkcs1_v1_5_with_sha3_512[DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_512];
    150 
    151 /*
    152  * md4WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 3 }
    153  */
    154 #define DER_OID_V_md4WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x03
    155 #define DER_OID_SZ_md4WithRSAEncryption 11
    156 extern const unsigned char ossl_der_oid_md4WithRSAEncryption[DER_OID_SZ_md4WithRSAEncryption];
    157 
    158 /*
    159  * ripemd160WithRSAEncryption    OBJECT IDENTIFIER ::= {
    160  *     iso(1) identified-organization(3) teletrust(36) algorithm(3) signatureAlgorithm(3) rsaSignature(1) 2
    161  * }
    162  */
    163 #define DER_OID_V_ripemd160WithRSAEncryption DER_P_OBJECT, 6, 0x2B, 0x24, 0x03, 0x03, 0x01, 0x02
    164 #define DER_OID_SZ_ripemd160WithRSAEncryption 8
    165 extern const unsigned char ossl_der_oid_ripemd160WithRSAEncryption[DER_OID_SZ_ripemd160WithRSAEncryption];
    166 
    167 /*
    168  * mdc2WithRSASignature OBJECT IDENTIFIER ::= {
    169  *     iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2) mdc2WithRSASignature(14)
    170  * }
    171  */
    172 #define DER_OID_V_mdc2WithRSASignature DER_P_OBJECT, 5, 0x2B, 0x0E, 0x03, 0x02, 0x0E
    173 #define DER_OID_SZ_mdc2WithRSASignature 7
    174 extern const unsigned char ossl_der_oid_mdc2WithRSASignature[DER_OID_SZ_mdc2WithRSASignature];
    175 
    176 
    177 /* PSS parameters */
    178 int ossl_DER_w_RSASSA_PSS_params(WPACKET *pkt, int tag,
    179                                  const RSA_PSS_PARAMS_30 *pss);
    180 /* Subject Public Key Info */
    181 int ossl_DER_w_algorithmIdentifier_RSA(WPACKET *pkt, int tag, RSA *rsa);
    182 int ossl_DER_w_algorithmIdentifier_RSA_PSS(WPACKET *pkt, int tag,
    183                                            int rsa_type,
    184                                            const RSA_PSS_PARAMS_30 *pss);
    185 /* Signature */
    186 int ossl_DER_w_algorithmIdentifier_MDWithRSAEncryption(WPACKET *pkt, int tag,
    187                                                        int mdnid);
    188