Lines Matching refs:pos
171 len = fwrite(buf_getptr(buf, buf->len - buf->pos),
172 1, buf->len - buf->pos, fp);
174 } while (len > 0 && buf->len != buf->pos);
178 if (buf->pos != buf->len) {
701 int nnumbers = -1, pos, len, seqlen, i;
896 pos = 0;
897 pos += ber_write_id_len(outblob+pos, 16, seqlen, ASN1_CONSTRUCTED);
899 pos += ber_write_id_len(outblob+pos, 2, numbers[i].bytes, 0);
900 memcpy(outblob+pos, numbers[i].start, numbers[i].bytes);
901 pos += numbers[i].bytes;
921 dropbear_assert(pos == len);
922 while (pos < outlen) {
923 outblob[pos++] = outlen - len;
1176 int pos, len, answer;
1192 pos = 8;
1193 if (key->keyblob_len < pos+4)
1195 pos += 4 + GET_32BIT(key->keyblob + pos); /* skip key type */
1196 if (key->keyblob_len < pos+4)
1198 len = GET_32BIT(key->keyblob + pos); /* find cipher-type length */
1199 if (key->keyblob_len < pos+4+len)
1201 if (len != 4 || 0 != memcmp(key->keyblob + pos + 4, "none", 4))
1259 int pos, len;
1285 pos = 8;
1286 if (key->keyblob_len < pos+4 ||
1287 (len = GET_32BIT(key->keyblob + pos)) > key->keyblob_len - pos - 4) {
1292 pos+4, prefix_rsa, sizeof(prefix_rsa) - 1)) {
1295 !memcmp(key->keyblob+pos+4, prefix_dsa, sizeof(prefix_dsa) - 1)) {
1301 pos += 4+len;
1306 if (key->keyblob_len < pos+4 ||
1307 (len = GET_32BIT(key->keyblob + pos)) > key->keyblob_len - pos - 4) {
1311 if (len == 4 && !memcmp(key->keyblob+pos+4, "none", 4))
1313 else if (len == 8 && !memcmp(key->keyblob+pos+4, "3des-cbc", 8))
1319 pos += 4+len;
1324 if (key->keyblob_len < pos+4 ||
1325 (len = GET_32BIT(key->keyblob + pos)) > key->keyblob_len - pos - 4) {
1329 ciphertext = (char *)key->keyblob + pos + 4;
1407 int pos = 0;
1408 pos += sshcom_read_mpint(ciphertext+pos, cipherlen-pos, &e);
1409 pos += sshcom_read_mpint(ciphertext+pos, cipherlen-pos, &d);
1410 pos += sshcom_read_mpint(ciphertext+pos, cipherlen-pos, &n);
1411 pos += sshcom_read_mpint(ciphertext+pos, cipherlen-pos, &u);
1412 pos += sshcom_read_mpint(ciphertext+pos, cipherlen-pos, &p);
1413 pos += sshcom_read_mpint(ciphertext+pos, cipherlen-pos, &q);
1420 pos = 0;
1421 pos += put_string(blob+pos, "ssh-rsa", 7);
1422 pos += put_mp(blob+pos, e.start, e.bytes);
1423 pos += put_mp(blob+pos, n.start, n.bytes);
1424 publen = pos;
1425 pos += put_string(blob+pos, d.start, d.bytes);
1426 pos += put_mp(blob+pos, q.start, q.bytes);
1427 pos += put_mp(blob+pos, p.start, p.bytes);
1428 pos += put_mp(blob+pos, u.start, u.bytes);
1429 privlen = pos - publen;
1432 int pos = 4;
1437 pos += sshcom_read_mpint(ciphertext+pos, cipherlen-pos, &p);
1438 pos += sshcom_read_mpint(ciphertext+pos, cipherlen-pos, &g);
1439 pos += sshcom_read_mpint(ciphertext+pos, cipherlen-pos, &q);
1440 pos += sshcom_read_mpint(ciphertext+pos, cipherlen-pos, &y);
1441 pos += sshcom_read_mpint(ciphertext+pos, cipherlen-pos, &x);
1448 pos = 0;
1449 pos += put_string(blob+pos, "ssh-dss", 7);
1450 pos += put_mp(blob+pos, p.start, p.bytes);
1451 pos += put_mp(blob+pos, q.start, q.bytes);
1452 pos += put_mp(blob+pos, g.start, g.bytes);
1453 pos += put_mp(blob+pos, y.start, y.bytes);
1454 publen = pos;
1455 pos += put_mp(blob+pos, x.start, x.bytes);
1456 privlen = pos - publen;
1494 int nnumbers, initial_zero, pos, lenpos, i;
1513 int pos;
1516 pos = 4 + GET_32BIT(pubblob);
1517 pos += ssh2_read_mpint(pubblob+pos, publen-pos, &e);
1518 pos += ssh2_read_mpint(pubblob+pos, publen-pos, &n);
1519 pos = 0;
1520 pos += ssh2_read_mpint(privblob+pos, privlen-pos, &d);
1521 pos += ssh2_read_mpint(privblob+pos, privlen-pos, &p);
1522 pos += ssh2_read_mpint(privblob+pos, privlen-pos, &q);
1523 pos += ssh2_read_mpint(privblob+pos, privlen-pos, &iqmp);
1538 int pos;
1541 pos = 4 + GET_32BIT(pubblob);
1542 pos += ssh2_read_mpint(pubblob+pos, publen-pos, &p);
1543 pos += ssh2_read_mpint(pubblob+pos, publen-pos, &q);
1544 pos += ssh2_read_mpint(pubblob+pos, publen-pos, &g);
1545 pos += ssh2_read_mpint(pubblob+pos, publen-pos, &y);
1546 pos = 0;
1547 pos += ssh2_read_mpint(privblob+pos, privlen-pos, &x);
1577 pos = 0;
1578 PUT_32BIT(outblob+pos, SSHCOM_MAGIC_NUMBER); pos += 4;
1579 pos += 4; /* length field, fill in later */
1580 pos += put_string(outblob+pos, type, strlen(type));
1583 pos += put_string(outblob+pos, ciphertype, strlen(ciphertype));
1585 lenpos = pos; /* remember this position */
1586 pos += 4; /* encrypted-blob size */
1587 pos += 4; /* encrypted-payload size */
1589 PUT_32BIT(outblob+pos, 0);
1590 pos += 4;
1593 pos += sshcom_put_mpint(outblob+pos,
1596 PUT_32BIT(outblob+lenpos+4, pos - (lenpos+8));
1599 int padding = -(pos - (lenpos+4)) & 7;
1601 outblob[pos++] = random_byte();
1604 cipherlen = pos - (lenpos+4);
1609 PUT_32BIT(outblob+4, pos);
1611 dropbear_assert(pos < outlen);
1673 base64_encode_fp(fp, outblob, pos, 70);