Skip to content

Commit 72df81d

Browse files
authored
Merge pull request #279 from aau-network-security/enable-description-#264
Enable description #264
2 parents 08954cc + 3aac956 commit 72df81d

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

store/exercise.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ type FlagConfig struct {
164164
EnvVar string `yaml:"env"`
165165
Static string `yaml:"static"`
166166
Points uint `yaml:"points"`
167+
Description string `yaml:"description"`
168+
Category string `yaml:"category"`
167169
}
168170

169171
func (fc FlagConfig) Validate() error {

svcs/ctfd/ctfd.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ func (ctf *ctfd) configureInstance() error {
262262
for id, flag := range ctf.conf.Flags {
263263
value := ctf.flagPool.AddFlag(flag, id+1)
264264

265-
if err := ctf.createFlag(flag.Name, value, flag.Points); err != nil {
265+
if err := ctf.createFlag(flag.Name,value,flag.Description,flag.Category,flag.Points); err != nil {
266266
return err
267267
}
268268

@@ -329,7 +329,7 @@ func (nc *nonceClient) getNonce(path string) (string, error) {
329329
return string(matches[0][1]), nil
330330
}
331331

332-
func (ctf *ctfd) createFlag(name, flag string, points uint) error {
332+
func (ctf *ctfd) createFlag(name,flagValue,description,category string,points uint) error {
333333
endpoint := ctf.nc.baseUrl() + "/admin/chal/new"
334334

335335
nonce, err := ctf.nc.getNonce(endpoint)
@@ -342,11 +342,11 @@ func (ctf *ctfd) createFlag(name, flag string, points uint) error {
342342
values := map[string]string{
343343
"name": name,
344344
"value": fmt.Sprintf("%d", points),
345-
"key": flag,
345+
"key": flagValue,
346346
"nonce": nonce,
347347
"key_type[0]": "static",
348-
"category": "",
349-
"description": "",
348+
"category": category,
349+
"description": description,
350350
"max_attempts": "",
351351
"chaltype": "standard",
352352
}

vboxmanage

Whitespace-only changes.

0 commit comments

Comments
 (0)