Path: blob/main/crypto/openssl/providers/common/include/prov/der_rsa.h
107435 views
/*1* WARNING: do not edit!2* Generated by Makefile from providers/common/include/prov/der_rsa.h.in3*4* Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.5*6* Licensed under the Apache License 2.0 (the "License"). You may not use7* this file except in compliance with the License. You can obtain a copy8* in the file LICENSE in the source distribution or at9* https://www.openssl.org/source/license.html10*/1112#include "crypto/rsa.h"13#include "internal/der.h"1415/* Well known OIDs precompiled */16/* clang-format off */1718/*19* hashAlgs OBJECT IDENTIFIER ::= { nistAlgorithms 2 }20*/21#define DER_OID_V_hashAlgs DER_P_OBJECT, 8, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x0222#define DER_OID_SZ_hashAlgs 1023extern const unsigned char ossl_der_oid_hashAlgs[DER_OID_SZ_hashAlgs];2425/*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, 0x0129#define DER_OID_SZ_rsaEncryption 1130extern const unsigned char ossl_der_oid_rsaEncryption[DER_OID_SZ_rsaEncryption];3132/*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, 0x0736#define DER_OID_SZ_id_RSAES_OAEP 1137extern const unsigned char ossl_der_oid_id_RSAES_OAEP[DER_OID_SZ_id_RSAES_OAEP];3839/*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, 0x0943#define DER_OID_SZ_id_pSpecified 1144extern const unsigned char ossl_der_oid_id_pSpecified[DER_OID_SZ_id_pSpecified];4546/*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, 0x0A50#define DER_OID_SZ_id_RSASSA_PSS 1151extern const unsigned char ossl_der_oid_id_RSASSA_PSS[DER_OID_SZ_id_RSASSA_PSS];5253/*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, 0x0257#define DER_OID_SZ_md2WithRSAEncryption 1158extern const unsigned char ossl_der_oid_md2WithRSAEncryption[DER_OID_SZ_md2WithRSAEncryption];5960/*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, 0x0464#define DER_OID_SZ_md5WithRSAEncryption 1165extern const unsigned char ossl_der_oid_md5WithRSAEncryption[DER_OID_SZ_md5WithRSAEncryption];6667/*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, 0x0571#define DER_OID_SZ_sha1WithRSAEncryption 1172extern const unsigned char ossl_der_oid_sha1WithRSAEncryption[DER_OID_SZ_sha1WithRSAEncryption];7374/*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, 0x0E78#define DER_OID_SZ_sha224WithRSAEncryption 1179extern const unsigned char ossl_der_oid_sha224WithRSAEncryption[DER_OID_SZ_sha224WithRSAEncryption];8081/*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, 0x0B85#define DER_OID_SZ_sha256WithRSAEncryption 1186extern const unsigned char ossl_der_oid_sha256WithRSAEncryption[DER_OID_SZ_sha256WithRSAEncryption];8788/*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, 0x0C92#define DER_OID_SZ_sha384WithRSAEncryption 1193extern const unsigned char ossl_der_oid_sha384WithRSAEncryption[DER_OID_SZ_sha384WithRSAEncryption];9495/*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, 0x0D99#define DER_OID_SZ_sha512WithRSAEncryption 11100extern const unsigned char ossl_der_oid_sha512WithRSAEncryption[DER_OID_SZ_sha512WithRSAEncryption];101102/*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, 0x0F106#define DER_OID_SZ_sha512_224WithRSAEncryption 11107extern const unsigned char ossl_der_oid_sha512_224WithRSAEncryption[DER_OID_SZ_sha512_224WithRSAEncryption];108109/*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, 0x10113#define DER_OID_SZ_sha512_256WithRSAEncryption 11114extern const unsigned char ossl_der_oid_sha512_256WithRSAEncryption[DER_OID_SZ_sha512_256WithRSAEncryption];115116/*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, 0x08120#define DER_OID_SZ_id_mgf1 11121extern const unsigned char ossl_der_oid_id_mgf1[DER_OID_SZ_id_mgf1];122123/*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, 0x0D127#define DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_224 11128extern 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];129130/*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, 0x0E134#define DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_256 11135extern 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];136137/*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, 0x0F141#define DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_384 11142extern 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];143144/*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, 0x10148#define DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_512 11149extern 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];150151/*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, 0x03155#define DER_OID_SZ_md4WithRSAEncryption 11156extern const unsigned char ossl_der_oid_md4WithRSAEncryption[DER_OID_SZ_md4WithRSAEncryption];157158/*159* ripemd160WithRSAEncryption OBJECT IDENTIFIER ::= {160* iso(1) identified-organization(3) teletrust(36) algorithm(3) signatureAlgorithm(3) rsaSignature(1) 2161* }162*/163#define DER_OID_V_ripemd160WithRSAEncryption DER_P_OBJECT, 6, 0x2B, 0x24, 0x03, 0x03, 0x01, 0x02164#define DER_OID_SZ_ripemd160WithRSAEncryption 8165extern const unsigned char ossl_der_oid_ripemd160WithRSAEncryption[DER_OID_SZ_ripemd160WithRSAEncryption];166167/*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, 0x0E173#define DER_OID_SZ_mdc2WithRSASignature 7174extern const unsigned char ossl_der_oid_mdc2WithRSASignature[DER_OID_SZ_mdc2WithRSASignature];175176/* clang-format on */177178/* PSS parameters */179int ossl_DER_w_RSASSA_PSS_params(WPACKET *pkt, int tag,180const RSA_PSS_PARAMS_30 *pss);181/* Subject Public Key Info */182int ossl_DER_w_algorithmIdentifier_RSA(WPACKET *pkt, int tag, RSA *rsa);183int ossl_DER_w_algorithmIdentifier_RSA_PSS(WPACKET *pkt, int tag,184int rsa_type,185const RSA_PSS_PARAMS_30 *pss);186/* Signature */187int ossl_DER_w_algorithmIdentifier_MDWithRSAEncryption(WPACKET *pkt, int tag,188int mdnid);189190191