Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Expanded tabs to spaces.

  • Loading branch information...
commit aa4f86164365d6cd991c2484b3ffe872c9428bf8 1 parent fd691de
Guenter Knauf gknauf authored
2  example/ssh2_agent.c
@@ -144,7 +144,7 @@ int main(int argc, char *argv[])
144 144 username, identity->comment);
145 145 break;
146 146 }
147   - prev_identity = identity;
  147 + prev_identity = identity;
148 148 }
149 149 if (rc) {
150 150 fprintf(stderr, "Couldn't continue authentication\n");
10 src/agent.c
@@ -268,7 +268,7 @@ agent_connect_pageant(LIBSSH2_AGENT *agent)
268 268 HWND hwnd;
269 269 hwnd = FindWindow("Pageant", "Pageant");
270 270 if (!hwnd)
271   - return _libssh2_error(agent->session, LIBSSH2_ERROR_AGENT_PROTOCOL,
  271 + return _libssh2_error(agent->session, LIBSSH2_ERROR_AGENT_PROTOCOL,
272 272 "failed connecting agent");
273 273 agent->fd = 0; /* Mark as the connection has been established */
274 274 return LIBSSH2_ERROR_NONE;
@@ -296,7 +296,7 @@ agent_transact_pageant(LIBSSH2_AGENT *agent, agent_transaction_ctx_t transctx)
296 296
297 297 sprintf(mapname, "PageantRequest%08x", (unsigned)GetCurrentThreadId());
298 298 filemap = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE,
299   - 0, PAGEANT_MAX_MSGLEN, mapname);
  299 + 0, PAGEANT_MAX_MSGLEN, mapname);
300 300
301 301 if (filemap == NULL || filemap == INVALID_HANDLE_VALUE)
302 302 return _libssh2_error(agent->session, LIBSSH2_ERROR_AGENT_PROTOCOL,
@@ -312,16 +312,16 @@ agent_transact_pageant(LIBSSH2_AGENT *agent, agent_transaction_ctx_t transctx)
312 312
313 313 id = SendMessage(hwnd, WM_COPYDATA, (WPARAM) NULL, (LPARAM) &cds);
314 314 if (id > 0) {
315   - transctx->response_len = _libssh2_ntohu32(p);
  315 + transctx->response_len = _libssh2_ntohu32(p);
316 316 if (transctx->response_len > PAGEANT_MAX_MSGLEN) {
317 317 UnmapViewOfFile(p);
318 318 CloseHandle(filemap);
319 319 return _libssh2_error(agent->session, LIBSSH2_ERROR_AGENT_PROTOCOL,
320 320 "agent setup fail");
321 321 }
322   - transctx->response = LIBSSH2_ALLOC(agent->session,
  322 + transctx->response = LIBSSH2_ALLOC(agent->session,
323 323 transctx->response_len);
324   - if (!transctx->response) {
  324 + if (!transctx->response) {
325 325 UnmapViewOfFile(p);
326 326 CloseHandle(filemap);
327 327 return _libssh2_error(agent->session, LIBSSH2_ERROR_ALLOC,
12 src/crypt.c
@@ -242,13 +242,13 @@ crypt_init_arcfour128(LIBSSH2_SESSION * session,
242 242 int rc;
243 243
244 244 rc = crypt_init (session, method, iv, free_iv, secret, free_secret,
245   - encrypt, abstract);
  245 + encrypt, abstract);
246 246 if (rc == 0) {
247   - struct crypt_ctx *cctx = *(struct crypt_ctx **) abstract;
248   - unsigned char block[8];
249   - size_t discard = 1536;
250   - for (; discard; discard -= 8)
251   - _libssh2_cipher_crypt(&cctx->h, cctx->algo, cctx->encrypt, block);
  247 + struct crypt_ctx *cctx = *(struct crypt_ctx **) abstract;
  248 + unsigned char block[8];
  249 + size_t discard = 1536;
  250 + for (; discard; discard -= 8)
  251 + _libssh2_cipher_crypt(&cctx->h, cctx->algo, cctx->encrypt, block);
252 252 }
253 253
254 254 return rc;
2  src/kex.c
@@ -1135,7 +1135,7 @@ static int kexinit(LIBSSH2_SESSION * session)
1135 1135 } else {
1136 1136 data = session->kexinit_data;
1137 1137 data_len = session->kexinit_data_len;
1138   - /* zap the variables to ensure there is NOT a double free later */
  1138 + /* zap the variables to ensure there is NOT a double free later */
1139 1139 session->kexinit_data = NULL;
1140 1140 session->kexinit_data_len = 0;
1141 1141 }
10 src/libgcrypt.c
@@ -537,11 +537,11 @@ _libssh2_cipher_init(_libssh2_cipher_ctx * h,
537 537
538 538 if (mode != GCRY_CIPHER_MODE_STREAM) {
539 539 int blklen = gcry_cipher_get_algo_blklen(cipher);
540   - if (mode == GCRY_CIPHER_MODE_CTR)
541   - ret = gcry_cipher_setctr(*h, iv, blklen);
542   - else
543   - ret = gcry_cipher_setiv(*h, iv, blklen);
544   - if (ret) {
  540 + if (mode == GCRY_CIPHER_MODE_CTR)
  541 + ret = gcry_cipher_setctr(*h, iv, blklen);
  542 + else
  543 + ret = gcry_cipher_setiv(*h, iv, blklen);
  544 + if (ret) {
545 545 gcry_cipher_close(*h);
546 546 return -1;
547 547 }
20 src/libgcrypt.h
@@ -110,25 +110,25 @@
110 110 #define _libssh2_gcry_cipher(c) (c >> 8)
111 111 #define _libssh2_gcry_mode(m) (m & 0xFF)
112 112
113   -#define _libssh2_cipher_aes256ctr \
  113 +#define _libssh2_cipher_aes256ctr \
114 114 _libssh2_gcry_ciphermode(GCRY_CIPHER_AES256, GCRY_CIPHER_MODE_CTR)
115   -#define _libssh2_cipher_aes192ctr \
  115 +#define _libssh2_cipher_aes192ctr \
116 116 _libssh2_gcry_ciphermode(GCRY_CIPHER_AES192, GCRY_CIPHER_MODE_CTR)
117   -#define _libssh2_cipher_aes128ctr \
  117 +#define _libssh2_cipher_aes128ctr \
118 118 _libssh2_gcry_ciphermode(GCRY_CIPHER_AES128, GCRY_CIPHER_MODE_CTR)
119   -#define _libssh2_cipher_aes256 \
  119 +#define _libssh2_cipher_aes256 \
120 120 _libssh2_gcry_ciphermode(GCRY_CIPHER_AES256, GCRY_CIPHER_MODE_CBC)
121   -#define _libssh2_cipher_aes192 \
  121 +#define _libssh2_cipher_aes192 \
122 122 _libssh2_gcry_ciphermode(GCRY_CIPHER_AES192, GCRY_CIPHER_MODE_CBC)
123   -#define _libssh2_cipher_aes128 \
  123 +#define _libssh2_cipher_aes128 \
124 124 _libssh2_gcry_ciphermode(GCRY_CIPHER_AES128, GCRY_CIPHER_MODE_CBC)
125   -#define _libssh2_cipher_blowfish \
  125 +#define _libssh2_cipher_blowfish \
126 126 _libssh2_gcry_ciphermode(GCRY_CIPHER_BLOWFISH, GCRY_CIPHER_MODE_CBC)
127   -#define _libssh2_cipher_arcfour \
  127 +#define _libssh2_cipher_arcfour \
128 128 _libssh2_gcry_ciphermode(GCRY_CIPHER_ARCFOUR, GCRY_CIPHER_MODE_STREAM)
129   -#define _libssh2_cipher_cast5 \
  129 +#define _libssh2_cipher_cast5 \
130 130 _libssh2_gcry_ciphermode(GCRY_CIPHER_CAST5, GCRY_CIPHER_MODE_CBC)
131   -#define _libssh2_cipher_3des \
  131 +#define _libssh2_cipher_3des \
132 132 _libssh2_gcry_ciphermode(GCRY_CIPHER_3DES, GCRY_CIPHER_MODE_CBC)
133 133
134 134
22 src/openssl.c
@@ -215,14 +215,14 @@ typedef struct
215 215
216 216 static int
217 217 aes_ctr_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
218   - const unsigned char *iv, int enc) /* init key */
  218 + const unsigned char *iv, int enc) /* init key */
219 219 {
220 220 aes_ctr_ctx *c = malloc(sizeof(*c));
221 221 const EVP_CIPHER *aes_cipher;
222 222 (void) enc;
223 223
224 224 if (c == NULL)
225   - return 0;
  225 + return 0;
226 226
227 227 switch (ctx->key_len) {
228 228 case 16:
@@ -239,7 +239,7 @@ aes_ctr_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
239 239 }
240 240 c->aes_ctx = malloc(sizeof(EVP_CIPHER_CTX));
241 241 if (c->aes_ctx == NULL)
242   - return 0;
  242 + return 0;
243 243
244 244 if (EVP_EncryptInit(c->aes_ctx, aes_cipher, key, NULL) != 1) {
245 245 return 0;
@@ -256,8 +256,8 @@ aes_ctr_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
256 256
257 257 static int
258 258 aes_ctr_do_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
259   - const unsigned char *in,
260   - unsigned int inl) /* encrypt/decrypt data */
  259 + const unsigned char *in,
  260 + unsigned int inl) /* encrypt/decrypt data */
261 261 {
262 262 aes_ctr_ctx *c = EVP_CIPHER_CTX_get_app_data(ctx);
263 263 unsigned char b1[AES_BLOCK_SIZE];
@@ -265,7 +265,7 @@ aes_ctr_do_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
265 265 int outlen = 0;
266 266
267 267 if (inl != 16) /* libssh2 only ever encrypt one block */
268   - return 0;
  268 + return 0;
269 269
270 270 if (c == NULL) {
271 271 return 0;
@@ -283,13 +283,13 @@ aes_ctr_do_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
283 283 }
284 284
285 285 for (i = 0; i < 16; i++)
286   - *out++ = *in++ ^ b1[i];
  286 + *out++ = *in++ ^ b1[i];
287 287
288 288 i = 15;
289 289 while (c->ctr[i]++ == 0xFF) {
290   - if (i == 0)
291   - break;
292   - i--;
  290 + if (i == 0)
  291 + break;
  292 + i--;
293 293 }
294 294
295 295 return 1;
@@ -727,7 +727,7 @@ _libssh2_pub_priv_keyfile(LIBSSH2_SESSION *session,
727 727 const char *passphrase)
728 728 {
729 729 int st;
730   - BIO* bp;
  730 + BIO* bp;
731 731 EVP_PKEY* pk;
732 732
733 733 _libssh2_debug(session,

0 comments on commit aa4f861

Please sign in to comment.
Something went wrong with that request. Please try again.