summaryrefslogtreecommitdiff
path: root/lib/mk-ca-bundle.vbs
diff options
context:
space:
mode:
authorGuenter Knauf <lists@gknw.net>2013-04-04 00:55:01 +0200
committerGuenter Knauf <lists@gknw.net>2013-04-04 00:55:01 +0200
commit7ba091ca824294ad0449b9f66485488b52ced4ab (patch)
treeb2920fb71a5f0abfc88d3ff02129292aa9efb28a /lib/mk-ca-bundle.vbs
parentce8a35c318d2e984d3f085b0c76566f50e7d297e (diff)
downloadcurl-7ba091ca824294ad0449b9f66485488b52ced4ab.tar.gz
Added a cont to specify base64 line wrap.
Diffstat (limited to 'lib/mk-ca-bundle.vbs')
-rwxr-xr-xlib/mk-ca-bundle.vbs10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/mk-ca-bundle.vbs b/lib/mk-ca-bundle.vbs
index 7fd74c176..170c7c4d5 100755
--- a/lib/mk-ca-bundle.vbs
+++ b/lib/mk-ca-bundle.vbs
@@ -26,7 +26,7 @@
'* Hacked by Guenter Knauf
'***************************************************************************
Option Explicit
-Const myVersion = "0.3.6"
+Const myVersion = "0.3.7"
Const myUrl = "http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1"
@@ -36,6 +36,7 @@ Const myCdSavF = FALSE ' Flag: save downloaded data to file certdata.txt
Const myCaBakF = TRUE ' Flag: backup existing ca-bundle certificate
Const myAskLiF = TRUE ' Flag: display certdata.txt license agreement
Const myAskTiF = TRUE ' Flag: ask to include certificate text info
+Const myWrapLe = 76 ' Default length of base64 output lines
'******************* Nothing to configure below! *******************
Dim objShell, objNetwork, objFSO, objHttp
@@ -239,7 +240,8 @@ End Function
Function Base64Encode(inData)
Const Base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
- Dim cOut, sOut, I
+ Dim cOut, sOut, lWrap, I
+ lWrap = Int(myWrapLe * 3 / 4)
'For each group of 3 bytes
For I = 1 To Len(inData) Step 3
@@ -265,9 +267,9 @@ Function Base64Encode(inData)
'Add the part To OutPut string
sOut = sOut + pOut
- 'Add a new line For Each 76 chars In dest (76*3/4 = 57)
+ 'Add a new line For Each myWrapLe chars In dest
If (I < Len(inData) - 2) Then
- If (I + 2) Mod 57 = 0 Then sOut = sOut & vbLf
+ If (I + 2) Mod lWrap = 0 Then sOut = sOut & vbLf
End If
Next
Select Case Len(inData) Mod 3