<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en" style='--code-editor-font: var(--default-mono-font, "GitLab Mono"), JetBrains Mono, Menlo, DejaVu Sans Mono, Liberation Mono, Consolas, Ubuntu Mono, Courier New, andale mono, lucida console, monospace;'>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>
GitLab
</title>

<style data-premailer="ignore" type="text/css">
a { color: #1068bf; }
</style>

<style>img {
max-width: 100%; height: auto;
}
body {
font-size: .875rem;
}
body {
-webkit-text-shadow: rgba(255,255,255,.01) 0 0 1px;
}
body {
font-family: "GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"; font-size: inherit;
}
</style>
</head>
<body style='font-size: inherit; -webkit-text-shadow: rgba(255,255,255,.01) 0 0 1px; font-family: "GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";'>
<div class="content">

<p style="color: #777777;">
<a href="https://gitlab.rtems.org/wmthornton-dev">Wayne Thornton</a>
<a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5332#note_130511">commented</a>:
</p>
<div class="md" style="position: relative; z-index: 1; color: #3a383f; word-wrap: break-word;">
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">Update: I've merged the newest upstream 'crypt.h' with the changes already made in the RTEMS source tree. I've separated out the code using the <strong style="font-weight: 600; margin-top: 0;">rtems</strong> preprocessor directive and updated the RTEMS APIs to allow (future) use of the newer additions, such as Blowfish and NTHash from upstream. I've the entire cpukit/libcrypt directory to contrib/cpukit/libcrypt and compiled from source for Sparc on my local machine and ran tests. Everything compiles, but as has always happened for me, 'crypt01.exe' fails testing. This occurred even prior to these changes so I assume it's something expected. The source code of the modified 'crypt.h' header is below:</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">`/* LINTLIBRARY <em style="margin-top: 0;">/
/</em>-</p>
<ul dir="auto" style="text-align: initial; list-style-type: disc; margin: 0 0 1rem; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">SPDX-License-Identifier: BSD-2-Clause</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">
</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">Copyright (c) 1999</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">
<div class="gl-relative markdown-code-block js-markdown-code" style="margin-top: 0;">
<pre class="code highlight js-syntax-highlight language-plaintext" v-pre="true" style='display: block; font-size: 14px; color: #3a383f; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 1rem; padding: 12px; border: 1px solid #dcdcde;'><code style='font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; border-radius: .25rem; background-color: inherit; white-space: pre; margin-top: 0; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; overflow-wrap: normal; padding: unset;'><span id="LC1" class="line" lang="plaintext" style="margin-top: 0;"> Mark Murray.  All rights reserved.</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">
</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">Copyright (C) 2025</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">
<div class="gl-relative markdown-code-block js-markdown-code" style="margin-top: 0;">
<pre class="code highlight js-syntax-highlight language-plaintext" v-pre="true" style='display: block; font-size: 14px; color: #3a383f; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 1rem; padding: 12px; border: 1px solid #dcdcde;'><code style='font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; border-radius: .25rem; background-color: inherit; white-space: pre; margin-top: 0; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; overflow-wrap: normal; padding: unset;'><span id="LC1" class="line" lang="plaintext" style="margin-top: 0;"> Wayne Michael Thornton (WMT). <wmthornton-dev@outlook.com></span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">
</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">Redistribution and use in source and binary forms, with or without</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">modification, are permitted provided that the following conditions</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">are met:</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">
<ol style="margin: 0; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">Redistributions of source code must retain the above copyright</li>
</ol>
</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">notice, this list of conditions and the following disclaimer.</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">
<ol start="2" style="margin: 0; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">Redistributions in binary form must reproduce the above copyright</li>
</ol>
</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">notice, this list of conditions and the following disclaimer in the</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">documentation and/or other materials provided with the distribution.</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">
</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">THIS SOFTWARE IS PROVIDED BY MARK MURRAY AND CONTRIBUTORS ``AS IS'' AND</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">ARE DISCLAIMED.  IN NO EVENT SHALL MARK MURRAY OR CONTRIBUTORS BE LIABLE</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">SUCH DAMAGE.</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">
</li>
</ul>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">*/</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">#ifndef _CRYPT_H
#define _CRYPT_H</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">#ifdef <strong style="font-weight: 600; margin-top: 0;">rtems</strong>
#include <sys/types.h>
#include <sys/queue.h>
#include <sys/cdefs.h></p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-plaintext" v-pre="true" style='display: block; font-size: 14px; color: #3a383f; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 1rem; padding: 12px; border: 1px solid #dcdcde;'><code style='font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; border-radius: .25rem; background-color: inherit; white-space: pre; margin-top: 0; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; overflow-wrap: normal; padding: unset;'><span id="LC1" class="line" lang="plaintext" style="margin-top: 0;">#define __BEGIN_DECLS</span>
<span id="LC2" class="line" lang="plaintext">#define __END_DECLS</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">#else
/* magic sizes <em style="margin-top: 0;">/
#define MD4_SIZE 16
#define MD5_SIZE 16
#endif /</em> <strong style="font-weight: 600;">rtems</strong> */</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">#ifdef <strong style="font-weight: 600; margin-top: 0;">rtems</strong></p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-plaintext" v-pre="true" style='display: block; font-size: 14px; color: #3a383f; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 1rem; padding: 12px; border: 1px solid #dcdcde;'><code style='font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; border-radius: .25rem; background-color: inherit; white-space: pre; margin-top: 0; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; overflow-wrap: normal; padding: unset;'><span id="LC1" class="line" lang="plaintext" style="margin-top: 0;">__BEGIN_DECLS</span>
<span id="LC2" class="line" lang="plaintext">struct crypt_data {</span>
<span id="LC3" class="line" lang="plaintext">    char buffer[256];</span>
<span id="LC4" class="line" lang="plaintext">};</span>
<span id="LC5" class="line" lang="plaintext"></span>
<span id="LC6" class="line" lang="plaintext">struct crypt_format {</span>
<span id="LC7" class="line" lang="plaintext">    SLIST_ENTRY(crypt_format) link;</span>
<span id="LC8" class="line" lang="plaintext">    char *(*func)(const char *, const char *, struct crypt_data *);</span>
<span id="LC9" class="line" lang="plaintext">    const char *magic;</span>
<span id="LC10" class="line" lang="plaintext">};</span>
<span id="LC11" class="line" lang="plaintext"></span>
<span id="LC12" class="line" lang="plaintext">#define CRYPT_FORMAT_INITIALIZER(func, magic) { { NULL }, (func), (magic) }</span>
<span id="LC13" class="line" lang="plaintext"></span>
<span id="LC14" class="line" lang="plaintext">extern struct crypt_format crypt_des_format;</span>
<span id="LC15" class="line" lang="plaintext"></span>
<span id="LC16" class="line" lang="plaintext">extern struct crypt_format crypt_md5_format;</span>
<span id="LC17" class="line" lang="plaintext"></span>
<span id="LC18" class="line" lang="plaintext">extern struct crypt_format crypt_nthash_format;</span>
<span id="LC19" class="line" lang="plaintext"></span>
<span id="LC20" class="line" lang="plaintext">extern struct crypt_format crypt_blowfish_format;</span>
<span id="LC21" class="line" lang="plaintext"></span>
<span id="LC22" class="line" lang="plaintext">extern struct crypt_format crypt_sha256_format;</span>
<span id="LC23" class="line" lang="plaintext"></span>
<span id="LC24" class="line" lang="plaintext">extern struct crypt_format crypt_sha512_format;</span>
<span id="LC25" class="line" lang="plaintext"></span>
<span id="LC26" class="line" lang="plaintext">void crypt_add_format(struct crypt_format *);</span>
<span id="LC27" class="line" lang="plaintext"></span>
<span id="LC28" class="line" lang="plaintext">char *crypt_r(const char *, const char *, struct crypt_data *);</span>
<span id="LC29" class="line" lang="plaintext"></span>
<span id="LC30" class="line" lang="plaintext">char *crypt_des_r(const char *, const char *, struct crypt_data *);</span>
<span id="LC31" class="line" lang="plaintext">char *crypt_md5_r(const char *, const char *, struct crypt_data *);</span>
<span id="LC32" class="line" lang="plaintext">char *crypt_nthash_r(const char *, const char *, struct crypt_data *);</span>
<span id="LC33" class="line" lang="plaintext">char *crypt_blowfish_r(const char *, const char *, struct crypt_data *);</span>
<span id="LC34" class="line" lang="plaintext">char *crypt_sha256_r(const char *, const char *, struct crypt_data *);</span>
<span id="LC35" class="line" lang="plaintext">char *crypt_sha512_r(const char *, const char *, struct crypt_data *);</span>
<span id="LC36" class="line" lang="plaintext"></span>
<span id="LC37" class="line" lang="plaintext">void _crypt_to64(char *s, u_long v, int n);</span>
<span id="LC38" class="line" lang="plaintext"></span>
<span id="LC39" class="line" lang="plaintext">#define b64_from_24bit _crypt_b64_from_24bit</span>
<span id="LC40" class="line" lang="plaintext">void _crypt_b64_from_24bit(uint8_t, uint8_t, uint8_t, int, int *, char **);</span>
<span id="LC41" class="line" lang="plaintext"></span>
<span id="LC42" class="line" lang="plaintext">__END_DECLS</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">#else</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">int crypt_des(const char *pw, const char *salt, char *buf);
int crypt_md5(const char *pw, const char *salt, char *buf);
int crypt_nthash(const char *pw, const char *salt, char *buf);
int crypt_blowfish(const char *pw, const char *salt, char *buf);
int crypt_sha256 (const char *pw, const char *salt, char *buf);
int crypt_sha512 (const char *pw, const char *salt, char *buf);</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">extern void _crypt_to64(char *s, u_long v, int n);
extern void b64_from_24bit(uint8_t B2, uint8_t B1, uint8_t B0, int n, char **cp);</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">#endif /* <strong style="font-weight: 600; margin-top: 0;">rtems</strong> */</p>
<p dir="auto" style="color: #3a383f; margin: 0;" align="initial">#endif /* _CRYPT_H */
`</p>
</div>


</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #626168;">

<br>
<a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5332#note_130511">View it on GitLab</a>.
<br>
You're receiving this email because of your account on <a target="_blank" rel="noopener noreferrer" href="https://gitlab.rtems.org">gitlab.rtems.org</a>. <a href="https://gitlab.rtems.org/-/sent_notifications/2ea67a17abd767fa841e251c8ae58c70/unsubscribe" target="_blank" rel="noopener noreferrer">Unsubscribe</a> from this thread · <a href="https://gitlab.rtems.org/-/profile/notifications" target="_blank" rel="noopener noreferrer" class="mng-notif-link">Manage all notifications</a> · <a href="https://gitlab.rtems.org/help" target="_blank" rel="noopener noreferrer" class="help-link">Help</a>
<span style="color: transparent; font-size: 0; display: none; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0;">
Notification message regarding https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5332#note_130511 at 1757111224
</span>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5332#note_130511"}}</script>


</p>
</div>
</body>
</html>