[cpp-sp] branch master updated: Add parameter to control secret key size.

Scott Cantor cantor.2 at osu.edu
Mon Mar 19 15:06:58 EDT 2018


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository cpp-sp.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=b5b1db2d5a0114ddd905c417dd5d725ea06e5f89

The following commit(s) were added to refs/heads/master by this push:
       new  b5b1db2   Add parameter to control secret key size.
b5b1db2 is described below

commit b5b1db2d5a0114ddd905c417dd5d725ea06e5f89
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Mar 19 15:06:53 2018 -0400

    Add parameter to control secret key size.
---
 configs/seckeygen.bat | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/configs/seckeygen.bat b/configs/seckeygen.bat
index 579c62d..016b187 100644
--- a/configs/seckeygen.bat
+++ b/configs/seckeygen.bat
@@ -2,6 +2,7 @@
 setlocal ENABLEDELAYEDEXPANSION
 
 set /A HISTORY=14
+set /A BYTES=16
 set FILENAME=sealer.keys
 set OUT=%~dp0
 
@@ -11,6 +12,7 @@ set PARAM=%1
 if not defined PARAM goto opt_end
 if %1==-o goto opt_out
 if %1==-h goto opt_history
+if %1==-b goto opt_bits
 if %1==-f goto opt_filename
 goto usage
 :opt_end
@@ -29,7 +31,7 @@ echo Removing %CHOP% old key(s)...
 if exist %OUT%\%FILENAME% (goto :regurgitate) else (set /A KEYVER=1)
 
 :addkey
-for /F %%a in ('openssl.exe rand -base64 16') do set KEYVAL=%%a
+for /F %%a in ('openssl.exe rand -base64 %BYTES%') do set KEYVAL=%%a
 echo %KEYVER%:%KEYVAL% >> %OUT%\%FILENAME%.tmp
 move /Y %OUT%\%FILENAME%.tmp %OUT%\%FILENAME%
 echo Added key version: %KEYVER%
@@ -60,11 +62,17 @@ shift
 goto opt_start
 
 :opt_history
-set HISTORY=%2
+set /A HISTORY=%2
+shift
+shift
+goto opt_start
+
+:opt_bits
+set /A BYTES=%2 / 8
 shift
 shift
 goto opt_start
 
 :usage
-echo usage: seckeygen [-h key history to maintain] [-f filename] [-o output dir]
+echo usage: seckeygen [-h key history to maintain] [-b key bits] [-f filename] [-o output dir]
 exit /b

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list