iPXE
rsa_md5.c
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2015 Michael Brown <mbrown@fensystems.co.uk>.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License as
00006  * published by the Free Software Foundation; either version 2 of the
00007  * License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017  * 02110-1301, USA.
00018  *
00019  * You can also choose to distribute this program under the terms of
00020  * the Unmodified Binary Distribution Licence (as given in the file
00021  * COPYING.UBDL), provided that you have satisfied its requirements.
00022  */
00023 
00024 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00025 
00026 #include <ipxe/rsa.h>
00027 #include <ipxe/md5.h>
00028 #include <ipxe/asn1.h>
00029 
00030 /** "md5WithRSAEncryption" object identifier */
00031 static uint8_t oid_md5_with_rsa_encryption[] =
00032         { ASN1_OID_MD5WITHRSAENCRYPTION };
00033 
00034 /** "md5WithRSAEncryption" OID-identified algorithm */
00035 struct asn1_algorithm md5_with_rsa_encryption_algorithm __asn1_algorithm = {
00036         .name = "md5WithRSAEncryption",
00037         .pubkey = &rsa_algorithm,
00038         .digest = &md5_algorithm,
00039         .oid = ASN1_OID_CURSOR ( oid_md5_with_rsa_encryption ),
00040 };
00041 
00042 /** MD5 digestInfo prefix */
00043 static const uint8_t rsa_md5_prefix_data[] =
00044         { RSA_DIGESTINFO_PREFIX ( MD5_DIGEST_SIZE, ASN1_OID_MD5 ) };
00045 
00046 /** MD5 digestInfo prefix */
00047 struct rsa_digestinfo_prefix rsa_md5_prefix __rsa_digestinfo_prefix = {
00048         .digest = &md5_algorithm,
00049         .data = rsa_md5_prefix_data,
00050         .len = sizeof ( rsa_md5_prefix_data ),
00051 };