Merge branch 'certfix' into silent

This commit is contained in:
idk
2020-11-17 16:15:20 +00:00
committed by GitHub

View File

@ -709,7 +709,7 @@ int sam3GenerateKeys(Sam3Session *ses, const char *hostname, int port,
*priv = sam3FindField(rep, "PRIV");
//
if (pub != NULL && sam3CheckValidKeyLength(pub) && priv != NULL &&
strlen(priv) == SAM3_PRIVKEY_MIN_SIZE) {
strlen(priv) >= SAM3_PRIVKEY_MIN_SIZE) {
strcpy(ses->pubkey, pub);
strcpy(ses->privkey, priv);
res = 0;
@ -840,7 +840,7 @@ int sam3CreateSession(Sam3Session *ses, const char *hostname, int port,
ses->fwd_fd = -1;
ses->silent = false;
//
if (privkey != NULL && strlen(privkey) != SAM3_PRIVKEY_MIN_SIZE)
if (privkey != NULL && strlen(privkey) < SAM3_PRIVKEY_MIN_SIZE)
goto error;
if ((int)type < 0 || (int)type > 2)
goto error;
@ -869,7 +869,7 @@ int sam3CreateSession(Sam3Session *ses, const char *hostname, int port,
goto error;
if (!sam3IsGoodReply(rep, "SESSION", "STATUS", "RESULT", "OK") ||
(v = sam3FindField(rep, "DESTINATION")) == NULL ||
strlen(v) != SAM3_PRIVKEY_MIN_SIZE) {
strlen(v) < SAM3_PRIVKEY_MIN_SIZE) {
if (libsam3_debug)
fprintf(stderr, "sam3CreateSession: invalid reply (%ld)...\n",
(v != NULL ? strlen(v) : -1));