<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
  img {
    max-width: 100%;
    height: auto;
  }
  p.details {
    font-style:italic;
    color:#777
  }
  .footer p {
    font-size:small;
    color:#777
  }
  pre.commit-message {
    white-space: pre-wrap;
  }
  .file-stats a {
    text-decoration: none;
  }
  .file-stats .new-file {
    color: #090;
  }
  .file-stats .deleted-file {
    color: #B00;
  }
</style>
<body>
<div class='content'>
<h3>Eric S. Raymond pushed to branch master at <a href="https://gitlab.com/NTPsec/ntpsec">NTPsec / ntpsec</a></h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/a19447d830271c725bdd9603adc511a8198b9aac">a19447d8</a></strong>
<div>
<span>by Eric S. Raymond</span>
<i>at 2015-11-29T14:59:00Z</i>
</div>
<pre class='commit-message'>TESTFRAME progess - intercept calls to read authkeys.</pre>
</li>
</ul>
<h4>4 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
include/ntp_intercept.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
ntpd/ntp_config.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
ntpd/ntp_intercept.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-3'>
ntpd/ntpd.c
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/a19447d830271c725bdd9603adc511a8198b9aac#diff-0'>
<strong>
include/ntp_intercept.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/include/ntp_intercept.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/include/ntp_intercept.h
</span><span style="color: #aaaaaa">@@ -39,5 +39,6 @@ int intercept_kernel_pll_adjtime(struct timex *);
</span> #endif
 extern bool intercept_leapsec_load_file(const char * fname, struct stat * sb,
                                        bool force, bool logall);
<span style="color: #000000;background-color: #ddffdd">+void intercept_getauthkeys(const char *);
</span> 
 /* end */
</code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/a19447d830271c725bdd9603adc511a8198b9aac#diff-1'>
<strong>
ntpd/ntp_config.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/ntp_config.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/ntp_config.c
</span><span style="color: #aaaaaa">@@ -1891,7 +1891,7 @@ config_auth(
</span> 
        /* Keys Command */
        if (ptree->auth.keys)
<span style="color: #000000;background-color: #ffdddd">-                getauthkeys(ptree->auth.keys);
</span><span style="color: #000000;background-color: #ddffdd">+           intercept_getauthkeys(ptree->auth.keys);
</span> 
        /* Control Key Command */
        if (ptree->auth.control_key)
</code></pre>

<br>
</li>
<li id='diff-2'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/a19447d830271c725bdd9603adc511a8198b9aac#diff-2'>
<strong>
ntpd/ntp_intercept.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/ntp_intercept.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/ntp_intercept.c
</span><span style="color: #aaaaaa">@@ -28,7 +28,7 @@ following kinds:
</span> 
 11. Packets outgoing to NTP daemons.  (TODO)
 
<span style="color: #000000;background-color: #ffdddd">-12. Read of authkey file  (TODO)
</span><span style="color: #000000;background-color: #ddffdd">+12. Read of authkey file
</span> 
 13. getaddrinfo() calls (TODO)
 
<span style="color: #aaaaaa">@@ -330,3 +330,28 @@ void intercept_sendpkt(const char *legend,
</span>   fputs("\n", stdout);
     }
 }
<span style="color: #000000;background-color: #ddffdd">+
+void
+intercept_getauthkeys(
+       const char  * fname)
+{
+    if (mode != replay)
+       getauthkeys(fname);
+
+    if (mode == capture) {
+       FILE *fp = fopen(fname, "r");
+       if (fp != NULL) {
+           int c;
+
+           fputs("startauthkeys\n", stdout);
+           while ((c = fgetc(fp)) != EOF)
+               putchar(c);
+           fclose(fp);
+           fputs("endauthkeys\n", stdout);
+       }
+    }
+
+    /* FIXME: replay logic goes here */
+}
+
+/* end */
</span></code></pre>

<br>
</li>
<li id='diff-3'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/a19447d830271c725bdd9603adc511a8198b9aac#diff-3'>
<strong>
ntpd/ntpd.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/ntpd.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/ntpd.c
</span><span style="color: #aaaaaa">@@ -802,7 +802,7 @@ ntpdmain(
</span>           }
                break;
            case 'k':
<span style="color: #000000;background-color: #ffdddd">-                getauthkeys(ntp_optarg);
</span><span style="color: #000000;background-color: #ddffdd">+           intercept_getauthkeys(ntp_optarg);
</span>           break;
            case 'M':
 # ifdef SYS_WINNT
</code></pre>

<br>
</li>

</div>
<div class='footer' style='margin-top: 10px;'>
<p>

<br>
<a href="https://gitlab.com/NTPsec/ntpsec/commit/a19447d830271c725bdd9603adc511a8198b9aac">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://gitlab.com/NTPsec/ntpsec/commit/a19447d830271c725bdd9603adc511a8198b9aac"}}</script>
</p>
</div>
</body>
</html>