Skip to content

Commit

Permalink
WinSCP 5.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
martinprikryl committed Jun 10, 2014
1 parent 1b7a627 commit 2bdb655
Show file tree
Hide file tree
Showing 86 changed files with 623 additions and 656 deletions.
35 changes: 18 additions & 17 deletions dotnet/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -470,32 +470,33 @@ public SynchronizationResult SynchronizeDirectories(
throw new ArgumentOutOfRangeException("mode");
}

List<string> criteriaNames = new List<string>();
if ((criteria & SynchronizationCriteria.Time) == SynchronizationCriteria.Time)
string criteriaName;
switch (criteria)
{
criteria -= SynchronizationCriteria.Time;
criteriaNames.Add("time");
}

if ((criteria & SynchronizationCriteria.Size) == SynchronizationCriteria.Size)
{
criteria -= SynchronizationCriteria.Size;
criteriaNames.Add("size");
}

if (criteria != 0)
{
throw new ArgumentOutOfRangeException("criteria");
case SynchronizationCriteria.None:
criteriaName = "none";
break;
case SynchronizationCriteria.Time:
criteriaName = "time";
break;
case SynchronizationCriteria.Size:
criteriaName = "size";
break;
case SynchronizationCriteria.Either:
criteriaName = "either";
break;
default:
throw new ArgumentOutOfRangeException("criteria");
}

WriteCommand(
string.Format(CultureInfo.InvariantCulture,
"synchronize {0} {1} {2} {3} {4} -- \"{5}\" \"{6}\"",
"synchronize {0} {1} {2} {3} -criteria=\"{4}\" -- \"{5}\" \"{6}\"",
modeName,
BooleanSwitch(removeFiles, "delete"),
BooleanSwitch(mirror, "mirror"),
options.ToSwitches(),
FormatSwitch("criteria", string.Join(",", criteriaNames.ToArray())),
criteriaName,
ArgumentEscape(localPath), ArgumentEscape(remotePath)));

return ReadSynchronizeDirectories();
Expand Down
15 changes: 15 additions & 0 deletions dotnet/SessionOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public SessionOptions()
public string UserName { get; set; }
public string Password { get; set; }
public TimeSpan Timeout { get { return _timeout; } set { SetTimeout(value); } }
public int TimeoutInMilliseconds { get { return GetTimeoutInMilliseconds(); } set { SetTimeoutInMilliseconds(value); } }

// SSH
public string SshHostKeyFingerprint { get { return _sshHostKeyFingerprint; } set { SetSshHostKeyFingerprint(value); } }
Expand Down Expand Up @@ -124,6 +125,20 @@ private void SetPortNumber(int value)
_portNumber = value;
}

private int GetTimeoutInMilliseconds()
{
if ((Timeout.TotalMilliseconds > int.MaxValue) || (Timeout.TotalMilliseconds < int.MinValue))
{
throw new InvalidCastException(string.Format(CultureInfo.CurrentCulture, "Cannot convert {0} to integer", Timeout));
}
return (int)Timeout.TotalMilliseconds;
}

private void SetTimeoutInMilliseconds(int value)
{
Timeout = TimeSpan.FromMilliseconds(value);
}

private string _sshHostKeyFingerprint;
private string _tlsHostCertificateFingerprint;
private TimeSpan _timeout;
Expand Down
8 changes: 4 additions & 4 deletions dotnet/internal/SessionLogReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,31 +188,31 @@ private void LogContents()

private void OpenLog()
{
Session.Logger.WriteLine("Opening log");

if (_closed)
{
throw new InvalidOperationException("Log was closed already");
}

try
{
Session.Logger.WriteLine("Opening log without write sharing");
// First try to open file without write sharing.
// This fails, if WinSCP is still writing to the log file.
// This is done only as a way to detect that log file is not complete yet.
_stream = File.Open(Session.XmlLogPath, FileMode.Open, FileAccess.Read, FileShare.Read);
_closed = true;
Session.Logger.WriteLine("Log opened without write sharing");
LogContents();
}
catch (IOException)
{
Session.Logger.WriteLine("Opening log with write sharing");
// If log file is still being written to, open it with write sharing
_stream = OpenLogFileWithWriteSharing();
_closed = false;
Session.Logger.WriteLine("Log opened with write sharing");
}

Session.Logger.WriteLine("Log opened");

_reader = XmlReader.Create(_stream);

int skip = _position;
Expand Down
6 changes: 3 additions & 3 deletions dotnet/properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a0b93468-d98a-4845-a234-8076229ad93f")]

[assembly: AssemblyVersion("1.1.5.0")]
[assembly: AssemblyFileVersion("1.1.5.0")]
[assembly: AssemblyInformationalVersionAttribute("5.5.3.0")]
[assembly: AssemblyVersion("1.1.6.0")]
[assembly: AssemblyFileVersion("1.1.6.0")]
[assembly: AssemblyInformationalVersionAttribute("5.5.4.0")]

[assembly: CLSCompliant(true)]

9 changes: 7 additions & 2 deletions libs/openssl/ACKNOWLEDGMENTS
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ OpenSSL project.
We would like to identify and thank the following such sponsors for their past
or current significant support of the OpenSSL project:

Major support:

Qualys http://www.qualys.com/

Very significant support:

OpenGear: www.opengear.com
OpenGear: http://www.opengear.com/

Significant support:

PSW Group: www.psw.net
PSW Group: http://www.psw.net/
Acano Ltd. http://acano.com/

Please note that we ask permission to identify sponsors and that some sponsors
we consider eligible for inclusion here have requested to remain anonymous.
Expand Down
2 changes: 1 addition & 1 deletion libs/openssl/crypto/asn1/a_strnid.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static int sk_table_cmp(const ASN1_STRING_TABLE * const *a,
* certain software (e.g. Netscape) has problems with them.
*/

static unsigned long global_mask = 0xFFFFFFFFL;
static unsigned long global_mask = B_ASN1_UTF8STRING;

void ASN1_STRING_set_default_mask(unsigned long mask)
{
Expand Down
46 changes: 26 additions & 20 deletions libs/openssl/crypto/bn/bn_mont.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,32 +478,38 @@ BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from)
BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock,
const BIGNUM *mod, BN_CTX *ctx)
{
int got_write_lock = 0;
BN_MONT_CTX *ret;

CRYPTO_r_lock(lock);
if (!*pmont)
ret = *pmont;
CRYPTO_r_unlock(lock);
if (ret)
return ret;

/* We don't want to serialise globally while doing our lazy-init math in
* BN_MONT_CTX_set. That punishes threads that are doing independent
* things. Instead, punish the case where more than one thread tries to
* lazy-init the same 'pmont', by having each do the lazy-init math work
* independently and only use the one from the thread that wins the race
* (the losers throw away the work they've done). */
ret = BN_MONT_CTX_new();
if (!ret)
return NULL;
if (!BN_MONT_CTX_set(ret, mod, ctx))
{
CRYPTO_r_unlock(lock);
CRYPTO_w_lock(lock);
got_write_lock = 1;
BN_MONT_CTX_free(ret);
return NULL;
}

if (!*pmont)
{
ret = BN_MONT_CTX_new();
if (ret && !BN_MONT_CTX_set(ret, mod, ctx))
BN_MONT_CTX_free(ret);
else
*pmont = ret;
}
/* The locked compare-and-set, after the local work is done. */
CRYPTO_w_lock(lock);
if (*pmont)
{
BN_MONT_CTX_free(ret);
ret = *pmont;
}

ret = *pmont;

if (got_write_lock)
CRYPTO_w_unlock(lock);
else
CRYPTO_r_unlock(lock);
*pmont = ret;
CRYPTO_w_unlock(lock);
return ret;
}
4 changes: 2 additions & 2 deletions libs/openssl/crypto/buildinf.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
/* auto-generated/updated by util/mk1mf.pl for crypto/cversion.c */
#define CFLAGS "cl /MD /Ox /O2 /Ob2 -DOPENSSL_THREADS -DDSO_WIN32 -DOPENSSL_USE_APPLINK -I. -DOPENSSL_NO_RC5 -DOPENSSL_NO_MD2 -DOPENSSL_NO_KRB5 -DOPENSSL_NO_JPAKE -DOPENSSL_NO_STATIC_ENGINE "
#define PLATFORM "VC-WIN32"
#define DATE "Wed Apr 9 09:25:41 2014"
#define DATE "Tue Jun 10 08:36:59 2014"
#endif
#ifdef MK1MF_PLATFORM_BC_NT
/* auto-generated/updated by util/mk1mf.pl for crypto/cversion.c */
#define CFLAGS "bcc32 -DWIN32_LEAN_AND_MEAN -q -w-ccc -w-rch -w-pia -w-aus -w-par -w-inl -c -tWC -tWM -DOPENSSL_SYSNAME_WIN32 -DL_ENDIAN -DDSO_WIN32 -D_stricmp=stricmp -D_strnicmp=strnicmp -D_timeb=timeb -D_ftime=ftime -O2 -ff -fp -DBN_ASM -DMD5_ASM -DSHA1_ASM -DRMD160_ASM -DOPENSSL_NO_RC5 -DOPENSSL_NO_MD2 -DOPENSSL_NO_KRB5 -DOPENSSL_NO_JPAKE -DOPENSSL_NO_DYNAMIC_ENGINE "
#define PLATFORM "BC-NT"
#define DATE "Wed Apr 9 09:25:42 2014"
#define DATE "Tue Jun 10 08:37:00 2014"
#endif
2 changes: 1 addition & 1 deletion libs/openssl/crypto/dso/dso_dlfcn.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ static int dlfcn_pathbyaddr(void *addr,char *path,int sz)
return len;
}

ERR_add_error_data(4, "dlfcn_pathbyaddr(): ", dlerror());
ERR_add_error_data(2, "dlfcn_pathbyaddr(): ", dlerror());
#endif
return -1;
}
Expand Down
1 change: 1 addition & 0 deletions libs/openssl/crypto/evp/bio_b64.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ static int b64_read(BIO *b, char *out, int outl)
else if (ctx->start)
{
q=p=(unsigned char *)ctx->tmp;
num = 0;
for (j=0; j<i; j++)
{
if (*(q++) != '\n') continue;
Expand Down
1 change: 1 addition & 0 deletions libs/openssl/crypto/evp/encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
v=EVP_DecodeBlock(out,d,n);
n=0;
if (v < 0) { rv=0; goto end; }
if (eof > v) { rv=-1; goto end; }
ret+=(v-eof);
}
else
Expand Down
6 changes: 3 additions & 3 deletions libs/openssl/crypto/opensslv.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
* (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
* major minor fix final patch/beta)
*/
#define OPENSSL_VERSION_NUMBER 0x1000107fL
#define OPENSSL_VERSION_NUMBER 0x1000108fL
#ifdef OPENSSL_FIPS
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1g-fips 7 Apr 2014"
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1h-fips 5 Jun 2014"
#else
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1g 7 Apr 2014"
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1h 5 Jun 2014"
#endif
#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT

Expand Down
8 changes: 8 additions & 0 deletions libs/openssl/crypto/pkcs12/p12_crt.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
nid_cert = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
else
#endif
#ifdef OPENSSL_NO_RC2
nid_cert = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
#else
nid_cert = NID_pbe_WithSHA1And40BitRC2_CBC;
#endif
}
if (!nid_key)
nid_key = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
Expand Down Expand Up @@ -286,7 +290,11 @@ int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
free_safes = 0;

if (nid_safe == 0)
#ifdef OPENSSL_NO_RC2
nid_safe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
#else
nid_safe = NID_pbe_WithSHA1And40BitRC2_CBC;
#endif

if (nid_safe == -1)
p7 = PKCS12_pack_p7data(bags);
Expand Down
2 changes: 1 addition & 1 deletion libs/openssl/crypto/pkcs12/p12_kiss.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen,
int len, r;
unsigned char *data;
len = ASN1_STRING_to_UTF8(&data, fname);
if(len > 0) {
if(len >= 0) {
r = X509_alias_set1(x509, data, len);
OPENSSL_free(data);
if (!r)
Expand Down
6 changes: 6 additions & 0 deletions libs/openssl/crypto/pkcs7/pk7_doit.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,11 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
{
case NID_pkcs7_signed:
data_body=PKCS7_get_octet_string(p7->d.sign->contents);
if (!PKCS7_is_detached(p7) && data_body == NULL)
{
PKCS7err(PKCS7_F_PKCS7_DATADECODE,PKCS7_R_INVALID_SIGNED_DATA_TYPE);
goto err;
}
md_sk=p7->d.sign->md_algs;
break;
case NID_pkcs7_signedAndEnveloped:
Expand Down Expand Up @@ -928,6 +933,7 @@ int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si)
if (EVP_DigestSignUpdate(&mctx,abuf,alen) <= 0)
goto err;
OPENSSL_free(abuf);
abuf = NULL;
if (EVP_DigestSignFinal(&mctx, NULL, &siglen) <= 0)
goto err;
abuf = OPENSSL_malloc(siglen);
Expand Down
1 change: 1 addition & 0 deletions libs/openssl/crypto/pkcs7/pkcs7.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ void ERR_load_PKCS7_strings(void);
#define PKCS7_R_ERROR_SETTING_CIPHER 121
#define PKCS7_R_INVALID_MIME_TYPE 131
#define PKCS7_R_INVALID_NULL_POINTER 143
#define PKCS7_R_INVALID_SIGNED_DATA_TYPE 155
#define PKCS7_R_MIME_NO_CONTENT_TYPE 132
#define PKCS7_R_MIME_PARSE_ERROR 133
#define PKCS7_R_MIME_SIG_PARSE_ERROR 134
Expand Down
3 changes: 2 additions & 1 deletion libs/openssl/crypto/pkcs7/pkcs7err.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* crypto/pkcs7/pkcs7err.c */
/* ====================================================================
* Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999-2014 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -130,6 +130,7 @@ static ERR_STRING_DATA PKCS7_str_reasons[]=
{ERR_REASON(PKCS7_R_ERROR_SETTING_CIPHER),"error setting cipher"},
{ERR_REASON(PKCS7_R_INVALID_MIME_TYPE) ,"invalid mime type"},
{ERR_REASON(PKCS7_R_INVALID_NULL_POINTER),"invalid null pointer"},
{ERR_REASON(PKCS7_R_INVALID_SIGNED_DATA_TYPE),"invalid signed data type"},
{ERR_REASON(PKCS7_R_MIME_NO_CONTENT_TYPE),"mime no content type"},
{ERR_REASON(PKCS7_R_MIME_PARSE_ERROR) ,"mime parse error"},
{ERR_REASON(PKCS7_R_MIME_SIG_PARSE_ERROR),"mime sig parse error"},
Expand Down
2 changes: 1 addition & 1 deletion libs/openssl/crypto/rsa/rsa_ameth.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ static int rsa_pss_param_print(BIO *bp, RSA_PSS_PARAMS *pss,
if (i2a_ASN1_INTEGER(bp, pss->saltLength) <= 0)
goto err;
}
else if (BIO_puts(bp, "0x14 (default)") <= 0)
else if (BIO_puts(bp, "14 (default)") <= 0)
goto err;
BIO_puts(bp, "\n");

Expand Down
3 changes: 3 additions & 0 deletions libs/openssl/crypto/srp/srp_vfy.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ static int t_fromb64(unsigned char *a, const char *src)
else a[i] = loc - b64table;
++i;
}
/* if nothing valid to process we have a zero length response */
if (i == 0)
return 0;
size = i;
i = size - 1;
j = size;
Expand Down
1 change: 1 addition & 0 deletions libs/openssl/crypto/ts/ts_rsp_verify.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,7 @@ static int TS_compute_imprint(BIO *data, TS_TST_INFO *tst_info,
X509_ALGOR_free(*md_alg);
OPENSSL_free(*imprint);
*imprint_len = 0;
*imprint = NULL;
return 0;
}

Expand Down
6 changes: 3 additions & 3 deletions libs/openssl/crypto/x509v3/v3_purp.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,8 @@ static void x509v3_cache_extensions(X509 *x)
/* Handle proxy certificates */
if((pci=X509_get_ext_d2i(x, NID_proxyCertInfo, NULL, NULL))) {
if (x->ex_flags & EXFLAG_CA
|| X509_get_ext_by_NID(x, NID_subject_alt_name, 0) >= 0
|| X509_get_ext_by_NID(x, NID_issuer_alt_name, 0) >= 0) {
|| X509_get_ext_by_NID(x, NID_subject_alt_name, -1) >= 0
|| X509_get_ext_by_NID(x, NID_issuer_alt_name, -1) >= 0) {
x->ex_flags |= EXFLAG_INVALID;
}
if (pci->pcPathLengthConstraint) {
Expand Down Expand Up @@ -670,7 +670,7 @@ static int check_purpose_timestamp_sign(const X509_PURPOSE *xp, const X509 *x,
return 0;

/* Extended Key Usage MUST be critical */
i_ext = X509_get_ext_by_NID((X509 *) x, NID_ext_key_usage, 0);
i_ext = X509_get_ext_by_NID((X509 *) x, NID_ext_key_usage, -1);
if (i_ext >= 0)
{
X509_EXTENSION *ext = X509_get_ext((X509 *) x, i_ext);
Expand Down
Loading

0 comments on commit 2bdb655

Please sign in to comment.