简体   繁体   English

Mac OS X磁盘映像验证

[英]Mac OS X Disk Image Verification

Does anyone knows what exactly happens behind the scenes when Mac OS X verifies a disk image (.dmg) file? 当Mac OS X验证磁盘映像(.dmg)文件时,有谁知道幕后到底发生了什么? Is there any way to extend or customize the procedure? 有没有办法扩展或自定义程序?

EDIT: I would like to create a disk image that verifies that it does exactly what it should do and nothing more. 编辑:我想创建一个磁盘映像,验证它确实完成它应该做什么,仅此而已。 For example, if I distribute some software that manages passwords, a malicious user could modify my package to send the passwords to an unwarranted third party. 例如,如果我分发一些管理密码的软件,恶意用户可以修改我的包以将密码发送给不合理的第三方。 To the end user, the functionality would appear to be identical to my program, and they would never know the package was sabotaged. 对于最终用户来说,功能看起来与我的程序完全相同,他们永远不会知道包被破坏了。 I would like to perform this verification at mount time. 我想在挂载时执行此验证。

To my knowledge, you cannot modify this procedure (unless you do some system hacks which I don't recommend). 据我所知,你不能修改这个程序(除非你做一些我不推荐的系统黑客)。 I believe it compares it with the internal checksum and makes sure that the disk's volume header is OK. 我相信它将它与内部校验和进行比较,并确保磁盘的卷标题正常。 It goes through all of the files to see if any of them are corrupted. 它遍历所有文件以查看其中是否有任何文件已损坏。

My understanding of dmg's is limited but as I understand it's essentially an osx specific archive format, similar to zips. 我对dmg的理解是有限的,但据我所知,它本质上是一种特定于osx的存档格式,类似于拉链。 One option would be to also distribute the checksum of your dmg. 一种选择是分发你的dmg的校验和。 This isn't very useful as if an attacker can change the dmg a user downloads from your site they can also modify the checksum. 这不是很有用,因为攻击者可以更改用户从您的站点下载的dmg,他们也可以修改校验和。

The functionality I believe you're looking for is codesigning. 我相信你正在寻找的功能是代码签名。 It's a cryptographic verification that an app hasn't been modified since it was signed by the author. 这是一个加密验证,自应用程序签名以来,应用程序未被修改。 There's a bit of a barrier to using this as you need a developer certificate from the apple developer program. 由于您需要Apple开发人员计划的开发人员证书,因此使用它有一点障碍。

Apple's documentation on codesigning can be found here: https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html#//apple_ref/doc/uid/TP40005929-CH4-SW5 关于代码签名的Apple文档可以在这里找到: https//developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html#//apple_ref/doc/uid/TP40005929-CH4-SW5

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM