<p>This PR adds the following:</p>
<ul>
<li>SHA-2 family of digests (sha224sum, sha256sum, sha384sum and sha512sum)</li>
<li>Multi-round rehashing support</li>
<li>Hashing of strings (instead of only images)</li>
<li>Apply result of the data last hashed to the configuration settings as hash:string</li>
<li>Apply the length of the data last hashed to the configuration settings as hashlen:int32</li>
</ul>
<p>It is also backward compatible with hashing one or more images as have been available in md5sum and sha1sum previous to the PR. The major difference is it will write or overwrite hash and hashlen with the last of the multiple images successfully hashed.</p>
<p>Without this PR, the hash functions seem to only provide a way to manually verify the digest results. With this the resulting digest string and the length of the image can both automatically be confirmed by the ipxe script.</p>
<p>Also consider the following situation, a company creates an ipxe efi module were they want it to go to an ipxe shell when DHCP fails. However, the company policy requires a password be verified to provide the shell access and also requires the password not be easy to extract even if the efi module is examined with a debugger.</p>
<p>This PR would allow a script such as this to be used:</p>
<p>#!ipxe<br>
dhcp || goto dhcpfail</p>
<h1>continue normal tasks</h1>
<p>:dhcpfail<br>
prompt DHCP has failed, press a key to login for shell access<br>
:loginshell<br>
login<br>
iseq ${username:string} ipxeadmin || goto loginshell<br>
set salt:string 3cbc63d0c64482c666d4dfb0516eed35<br>
md5sum --rounds 1000000 --str ${salt:string}${password:string}<br>
iseq ${hash:string} 1577df1969a3b8f0188496804645c406 || goto loginshell<br>
shell</p>
<p>Please feel free to let me know if there is problem with my code or even if there is problems with the concept I am trying to achieve with the code.</p>
<p>Thanks</p>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href='https://github.com/ipxe/ipxe/pull/94'>https://github.com/ipxe/ipxe/pull/94</a></p>
<h4>Commit Summary</h4>
<ul>
<li>Updated digest commands to include SHA-2 support, hash strings, perform multi-round hashing and apply the result in the configuration settings</li>
</ul>
<h4>File Changes</h4>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/ipxe/ipxe/pull/94/files#diff-0">src/hci/commands/digest_cmd.c</a>
(133)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/ipxe/ipxe/pull/94.patch'>https://github.com/ipxe/ipxe/pull/94.patch</a></li>
<li><a href='https://github.com/ipxe/ipxe/pull/94.diff'>https://github.com/ipxe/ipxe/pull/94.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/ipxe/ipxe/pull/94?email_source=notifications&email_token=AAFNGVFYCXLH5WQ7GGI2BYTQF5ESFA5CNFSM4IO3B6UKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HG53AIA">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAFNGVDKEASLLYCYPB5UYS3QF5ESFANCNFSM4IO3B6UA">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAFNGVC3NAM4NPXRXF2FW2DQF5ESFA5CNFSM4IO3B6UKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HG53AIA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/ipxe/ipxe/pull/94?email_source=notifications\u0026email_token=AAFNGVFYCXLH5WQ7GGI2BYTQF5ESFA5CNFSM4IO3B6UKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HG53AIA",
"url": "https://github.com/ipxe/ipxe/pull/94?email_source=notifications\u0026email_token=AAFNGVFYCXLH5WQ7GGI2BYTQF5ESFA5CNFSM4IO3B6UKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HG53AIA",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>