Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2011-12-16 14:23:01 +0400
committerTristan Gingold <gingold@adacore.com>2011-12-16 14:23:01 +0400
commit6625879aa6d76736eff81f2fb862a99330ae5c28 (patch)
treea382dcf6e4033b34a44b6bdd15d1f4ee53171389 /include/mach-o
parent08e4b6acb7c26e77fd1b52b063838459207d1708 (diff)
binutils/
2011-12-16 Tristan Gingold <gingold@adacore.com> * od-macho.c: Include mach-o/codesign.h (OPT_CODESIGN): Define. (options): Add an entry for codesign. (mach_o_help): Likewise. (dump_header): Fix indentation. (dump_thread): Do not test result of xmalloc. (bfd_mach_o_cs_magic, bfd_mach_o_cs_hash_type): New. (dump_code_signature_superblob): New function. (swap_code_codedirectory_v1_in): Likewise. (hexdump): Likewise. (dump_code_signature_codedirectory): Likewise. (dump_code_signature_blob, dump_code_signature): Likewise. (dump_load_command): Dump code signature. (mach_o_dump): Likewise. include/mach-o/ 2011-12-16 Tristan Gingold <gingold@adacore.com> * codesign.h: New file.
Diffstat (limited to 'include/mach-o')
-rw-r--r--include/mach-o/ChangeLog4
-rw-r--r--include/mach-o/codesign.h85
2 files changed, 89 insertions, 0 deletions
diff --git a/include/mach-o/ChangeLog b/include/mach-o/ChangeLog
index 2276d0145..9e5150582 100644
--- a/include/mach-o/ChangeLog
+++ b/include/mach-o/ChangeLog
@@ -1,3 +1,7 @@
+2011-12-16 Tristan Gingold <gingold@adacore.com>
+
+ * codesign.h: New file.
+
2011-08-08 Tristan Gingold <gingold@adacore.com>
* loader.h (bfd_mach_o_load_command_type): Add
diff --git a/include/mach-o/codesign.h b/include/mach-o/codesign.h
new file mode 100644
index 000000000..ee2f792ac
--- /dev/null
+++ b/include/mach-o/codesign.h
@@ -0,0 +1,85 @@
+/* Mach-O support for BFD.
+ Copyright 2011
+ Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+#ifndef _MACH_O_CODESIGN_H
+#define _MACH_O_CODESIGN_H
+
+/* Codesign blob magics. */
+
+/* Superblob containing all the components. */
+#define BFD_MACH_O_CS_MAGIC_EMBEDDED_SIGNATURE 0xfade0cc0
+
+/* Individual code requirement. */
+#define BFD_MACH_O_CS_MAGIC_REQUIREMENT 0xfade0c00
+
+/* Collection of code requirements, indexed by type. */
+#define BFD_MACH_O_CS_MAGIC_REQUIREMENTS 0xfade0c01
+
+/* Directory. */
+#define BFD_MACH_O_CS_MAGIC_CODEDIRECTORY 0xfade0c02
+
+/* Entitlements blob. */
+#define BFD_MACH_O_CS_MAGIC_EMBEDDED_ENTITLEMENTS 0xfade7171
+
+/* Blob container. */
+#define BFD_MACH_O_CS_MAGIC_BLOB_WRAPPER 0xfade0b01
+
+struct mach_o_codesign_codedirectory_external_v1
+{
+ /* All the fields are in network byte order (big endian). */
+ unsigned char version[4];
+ unsigned char flags[4];
+ unsigned char hash_offset[4];
+ unsigned char ident_offset[4];
+ unsigned char nbr_special_slots[4];
+ unsigned char nbr_code_slots[4];
+ unsigned char code_limit[4];
+ unsigned char hash_size[1];
+ unsigned char hash_type[1];
+ unsigned char spare1[1];
+ unsigned char page_size[1];
+ unsigned char spare2[4];
+};
+
+struct mach_o_codesign_codedirectory_v1
+{
+ unsigned int version;
+ unsigned int flags;
+ unsigned int hash_offset;
+ unsigned int ident_offset;
+ unsigned int nbr_special_slots;
+ unsigned int nbr_code_slots;
+ unsigned int code_limit;
+ unsigned char hash_size;
+ unsigned char hash_type;
+ unsigned char spare1;
+ unsigned char page_size;
+ unsigned int spare2;
+};
+
+/* Value for hash_type. */
+#define BFD_MACH_O_CS_NO_HASH 0
+#define BFD_MACH_O_CS_HASH_SHA1 1
+#define BFD_MACH_O_CS_HASH_SHA256 2
+#define BFD_MACH_O_CS_HASH_PRESTANDARD_SKEIN_160x256 32 /* Skein, 160 bits */
+#define BFD_MACH_O_CS_HASH_PRESTANDARD_SKEIN_256x512 33 /* Skein, 256 bits */
+
+#endif /* _MACH_O_CODESIGN_H */