mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Added a no_passphrase flag to hide the passphrase input field from the web interface.
This commit is contained in:
parent
7cf1580d5f
commit
ef0a92b491
3 changed files with 4 additions and 1 deletions
|
|
@ -23,6 +23,7 @@ type config struct {
|
|||
UploadSignature bool `toml:"upload_signature"`
|
||||
PGPURL string `toml:"pgp_url"`
|
||||
Domain string `toml:"domain"`
|
||||
NoPassphrase bool `toml:"no_passphrase"`
|
||||
}
|
||||
|
||||
type tlp string
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ func (c *controller) handleSignature(r *http.Request, data []byte) (string, stri
|
|||
|
||||
// Sign ourself
|
||||
|
||||
if passwd := r.FormValue("passphrase"); passwd != "" {
|
||||
if passwd := r.FormValue("passphrase"); !c.cfg.NoPassphrase && passwd != "" {
|
||||
if key, err = key.Unlock([]byte(passwd)); err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,9 +30,11 @@
|
|||
<textarea name="signature" id="signature" required="required" cols="65" rows="20"
|
||||
placeholder="Insert ASCII armored signature here ..."></textarea>
|
||||
{{ else }}
|
||||
{{ if not .Config.NoPassphrase }}
|
||||
<label for="passphrase">Key passphrase:</label>
|
||||
<input name="passphrase" type="password" id="passphrase">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<br>
|
||||
<input type="submit" value="Upload">
|
||||
</fieldset>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue