Merge branch 'certfix' into silent
This commit is contained in:
@ -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));
|
||||
|
Reference in New Issue
Block a user