Skip to content

Commit

Permalink
Add: create_credential error case for type
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmundell authored and timopollmeier committed Oct 12, 2023
1 parent a124a71 commit 02b1a00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -19886,6 +19886,11 @@ gmp_xml_handle_end_element (/* unused */ GMarkupParseContext* context,
(XML_ERROR_SYNTAX ("create_credential",
"Erroneous certificate"));
break;
case 18:
SEND_TO_CLIENT_OR_FAIL
(XML_ERROR_SYNTAX ("create_credential",
"Cannot determine type for new credential"));
break;
case 99:
SEND_TO_CLIENT_OR_FAIL
(XML_ERROR_SYNTAX ("create_credential",
Expand Down
5 changes: 3 additions & 2 deletions src/manage_sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -34457,7 +34457,8 @@ validate_credential_username_for_format (const gchar *username,
* 11 community missing, 12 auth algorithm missing,
* 14 privacy algorithm missing,
* 15 invalid auth algorithm, 16 invalid privacy algorithm,
* 17 invalid certificate, 99 permission denied, -1 error.
* 17 invalid certificate, 18 cannot determine type,
* 99 permission denied, -1 error.
*/
int
create_credential (const char* name, const char* comment, const char* login,
Expand Down Expand Up @@ -34534,7 +34535,7 @@ create_credential (const char* name, const char* comment, const char* login,
else
{
g_warning ("%s: Cannot determine type of new credential", __func__);
return -1;
return 18;
}

/* Validate credential data */
Expand Down

0 comments on commit 02b1a00

Please sign in to comment.