jcs's openbsd hax
openbsd

revert __bounded change; it causes way more problems for portable than it solves; pointed out by dtucker@

djm 37ec574a e1652f74

+43 -43
+6 -6
usr.bin/ssh/chacha.h
··· 1 - /* $OpenBSD: chacha.h,v 1.2 2014/03/26 04:55:35 djm Exp $ */ 1 + /* $OpenBSD: chacha.h,v 1.3 2014/05/02 03:27:54 djm Exp $ */ 2 2 3 3 /* 4 4 chacha-merged.c version 20080118 ··· 22 22 #define CHACHA_BLOCKLEN 64 23 23 24 24 void chacha_keysetup(struct chacha_ctx *x, const u_char *k, u_int kbits) 25 - __bounded((__minbytes__, 2, CHACHA_MINKEYLEN)); 25 + __attribute__((__bounded__(__minbytes__, 2, CHACHA_MINKEYLEN))); 26 26 void chacha_ivsetup(struct chacha_ctx *x, const u_char *iv, const u_char *ctr) 27 - __bounded((__minbytes__, 2, CHACHA_NONCELEN)) 28 - __bounded((__minbytes__, 3, CHACHA_CTRLEN)); 27 + __attribute__((__bounded__(__minbytes__, 2, CHACHA_NONCELEN))) 28 + __attribute__((__bounded__(__minbytes__, 3, CHACHA_CTRLEN))); 29 29 void chacha_encrypt_bytes(struct chacha_ctx *x, const u_char *m, 30 30 u_char *c, u_int bytes) 31 - __bounded((__buffer__, 2, 4)) 32 - __bounded((__buffer__, 3, 4)); 31 + __attribute__((__bounded__(__buffer__, 2, 4))) 32 + __attribute__((__bounded__(__buffer__, 3, 4))); 33 33 34 34 #endif /* CHACHA_H */ 35 35
+3 -3
usr.bin/ssh/cipher-chachapoly.h
··· 1 - /* $OpenBSD: cipher-chachapoly.h,v 1.2 2014/03/26 04:55:35 djm Exp $ */ 1 + /* $OpenBSD: cipher-chachapoly.h,v 1.3 2014/05/02 03:27:54 djm Exp $ */ 2 2 3 3 /* 4 4 * Copyright (c) Damien Miller 2013 <djm@mindrot.org> ··· 30 30 31 31 void chachapoly_init(struct chachapoly_ctx *cpctx, 32 32 const u_char *key, u_int keylen) 33 - __bounded((__buffer__, 2, 3)); 33 + __attribute__((__bounded__(__buffer__, 2, 3))); 34 34 int chachapoly_crypt(struct chachapoly_ctx *cpctx, u_int seqnr, 35 35 u_char *dest, const u_char *src, u_int len, u_int aadlen, u_int authlen, 36 36 int do_encrypt); 37 37 int chachapoly_get_length(struct chachapoly_ctx *cpctx, 38 38 u_int *plenp, u_int seqnr, const u_char *cp, u_int len) 39 - __bounded((__buffer__, 4, 5)); 39 + __attribute__((__bounded__(__buffer__, 4, 5))); 40 40 41 41 #endif /* CHACHA_POLY_AEAD_H */
+6 -6
usr.bin/ssh/digest.h
··· 1 - /* $OpenBSD: digest.h,v 1.3 2014/03/26 04:55:35 djm Exp $ */ 1 + /* $OpenBSD: digest.h,v 1.4 2014/05/02 03:27:54 djm Exp $ */ 2 2 /* 3 3 * Copyright (c) 2013 Damien Miller <djm@mindrot.org> 4 4 * ··· 45 45 /* One-shot API */ 46 46 int ssh_digest_memory(int alg, const void *m, size_t mlen, 47 47 u_char *d, size_t dlen) 48 - __bounded((__buffer__, 2, 3)) 49 - __bounded((__buffer__, 4, 5)); 48 + __attribute__((__bounded__(__buffer__, 2, 3))) 49 + __attribute__((__bounded__(__buffer__, 4, 5))); 50 50 int ssh_digest_buffer(int alg, const Buffer *b, u_char *d, size_t dlen) 51 - __bounded((__buffer__, 3, 4)); 51 + __attribute__((__bounded__(__buffer__, 3, 4))); 52 52 53 53 /* Update API */ 54 54 struct ssh_digest_ctx *ssh_digest_start(int alg); 55 55 int ssh_digest_update(struct ssh_digest_ctx *ctx, const void *m, size_t mlen) 56 - __bounded((__buffer__, 2, 3)); 56 + __attribute__((__bounded__(__buffer__, 2, 3))); 57 57 int ssh_digest_update_buffer(struct ssh_digest_ctx *ctx, const Buffer *b); 58 58 int ssh_digest_final(struct ssh_digest_ctx *ctx, u_char *d, size_t dlen) 59 - __bounded((__buffer__, 2, 3)); 59 + __attribute__((__bounded__(__buffer__, 2, 3))); 60 60 void ssh_digest_free(struct ssh_digest_ctx *ctx); 61 61 62 62 #endif /* _DIGEST_H */
+4 -4
usr.bin/ssh/hmac.h
··· 1 - /* $OpenBSD: hmac.h,v 1.7 2014/03/26 04:55:35 djm Exp $ */ 1 + /* $OpenBSD: hmac.h,v 1.8 2014/05/02 03:27:54 djm Exp $ */ 2 2 /* 3 3 * Copyright (c) 2014 Markus Friedl. All rights reserved. 4 4 * ··· 26 26 27 27 /* Sets the state of the HMAC or resets the state if key == NULL */ 28 28 int ssh_hmac_init(struct ssh_hmac_ctx *ctx, const void *key, size_t klen) 29 - __bounded((__buffer__, 2, 3)); 29 + __attribute__((__bounded__(__buffer__, 2, 3))); 30 30 int ssh_hmac_update(struct ssh_hmac_ctx *ctx, const void *m, size_t mlen) 31 - __bounded((__buffer__, 2, 3)); 31 + __attribute__((__bounded__(__buffer__, 2, 3))); 32 32 int ssh_hmac_update_buffer(struct ssh_hmac_ctx *ctx, const Buffer *b); 33 33 int ssh_hmac_final(struct ssh_hmac_ctx *ctx, u_char *d, size_t dlen) 34 - __bounded((__buffer__, 2, 3)); 34 + __attribute__((__bounded__(__buffer__, 2, 3))); 35 35 void ssh_hmac_free(struct ssh_hmac_ctx *ctx); 36 36 37 37 #endif /* _HMAC_H */
+5 -5
usr.bin/ssh/kex.h
··· 1 - /* $OpenBSD: kex.h,v 1.63 2014/03/26 04:55:35 djm Exp $ */ 1 + /* $OpenBSD: kex.h,v 1.64 2014/05/02 03:27:54 djm Exp $ */ 2 2 3 3 /* 4 4 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. ··· 182 182 183 183 #define CURVE25519_SIZE 32 184 184 void kexc25519_keygen(u_char[CURVE25519_SIZE], u_char[CURVE25519_SIZE]) 185 - __bounded((__minbytes__, 1, CURVE25519_SIZE)) 186 - __bounded((__minbytes__, 2, CURVE25519_SIZE)); 185 + __attribute__((__bounded__(__minbytes__, 1, CURVE25519_SIZE))) 186 + __attribute__((__bounded__(__minbytes__, 2, CURVE25519_SIZE))); 187 187 void kexc25519_shared_key(const u_char key[CURVE25519_SIZE], 188 188 const u_char pub[CURVE25519_SIZE], Buffer *out) 189 - __bounded((__minbytes__, 1, CURVE25519_SIZE)) 190 - __bounded((__minbytes__, 2, CURVE25519_SIZE)); 189 + __attribute__((__bounded__(__minbytes__, 1, CURVE25519_SIZE))) 190 + __attribute__((__bounded__(__minbytes__, 2, CURVE25519_SIZE))); 191 191 192 192 void 193 193 derive_ssh1_session_id(BIGNUM *, BIGNUM *, u_int8_t[8], u_int8_t[16]);
+4 -4
usr.bin/ssh/kexc25519.c
··· 1 - /* $OpenBSD: kexc25519.c,v 1.6 2014/03/26 04:55:35 djm Exp $ */ 1 + /* $OpenBSD: kexc25519.c,v 1.7 2014/05/02 03:27:54 djm Exp $ */ 2 2 /* 3 3 * Copyright (c) 2001, 2013 Markus Friedl. All rights reserved. 4 4 * Copyright (c) 2010 Damien Miller. All rights reserved. ··· 43 43 44 44 extern int crypto_scalarmult_curve25519(u_char a[CURVE25519_SIZE], 45 45 const u_char b[CURVE25519_SIZE], const u_char c[CURVE25519_SIZE]) 46 - __bounded((__minbytes__, 1, CURVE25519_SIZE)) 47 - __bounded((__minbytes__, 2, CURVE25519_SIZE)) 48 - __bounded((__minbytes__, 3, CURVE25519_SIZE)); 46 + __attribute__((__bounded__(__minbytes__, 1, CURVE25519_SIZE))) 47 + __attribute__((__bounded__(__minbytes__, 2, CURVE25519_SIZE))) 48 + __attribute__((__bounded__(__minbytes__, 3, CURVE25519_SIZE))); 49 49 50 50 void 51 51 kexc25519_keygen(u_char key[CURVE25519_SIZE], u_char pub[CURVE25519_SIZE])
+9 -9
usr.bin/ssh/misc.h
··· 1 - /* $OpenBSD: misc.h,v 1.52 2014/04/20 02:30:25 djm Exp $ */ 1 + /* $OpenBSD: misc.h,v 1.53 2014/05/02 03:27:54 djm Exp $ */ 2 2 3 3 /* 4 4 * Author: Tatu Ylonen <ylo@cs.hut.fi> ··· 68 68 69 69 /* Functions to extract or store big-endian words of various sizes */ 70 70 u_int64_t get_u64(const void *) 71 - __bounded(( __minbytes__, 1, 8)); 71 + __attribute__((__bounded__( __minbytes__, 1, 8))); 72 72 u_int32_t get_u32(const void *) 73 - __bounded(( __minbytes__, 1, 4)); 73 + __attribute__((__bounded__( __minbytes__, 1, 4))); 74 74 u_int16_t get_u16(const void *) 75 - __bounded(( __minbytes__, 1, 2)); 75 + __attribute__((__bounded__( __minbytes__, 1, 2))); 76 76 void put_u64(void *, u_int64_t) 77 - __bounded(( __minbytes__, 1, 8)); 77 + __attribute__((__bounded__( __minbytes__, 1, 8))); 78 78 void put_u32(void *, u_int32_t) 79 - __bounded(( __minbytes__, 1, 4)); 79 + __attribute__((__bounded__( __minbytes__, 1, 4))); 80 80 void put_u16(void *, u_int16_t) 81 - __bounded(( __minbytes__, 1, 2)); 81 + __attribute__((__bounded__( __minbytes__, 1, 2))); 82 82 83 83 /* Little-endian store/load, used by umac.c */ 84 84 u_int32_t get_u32_le(const void *) 85 - __bounded(( __minbytes__, 1, 4)); 85 + __attribute__((__bounded__(__minbytes__, 1, 4))); 86 86 void put_u32_le(void *, u_int32_t) 87 - __bounded(( __minbytes__, 1, 4)); 87 + __attribute__((__bounded__(__minbytes__, 1, 4))); 88 88 89 89 struct bwlimit { 90 90 size_t buflen;
+4 -4
usr.bin/ssh/poly1305.h
··· 1 - /* $OpenBSD: poly1305.h,v 1.3 2014/03/26 04:55:35 djm Exp $ */ 1 + /* $OpenBSD: poly1305.h,v 1.4 2014/05/02 03:27:54 djm Exp $ */ 2 2 3 3 /* 4 4 * Public Domain poly1305 from Andrew Moon ··· 15 15 16 16 void poly1305_auth(u_char out[POLY1305_TAGLEN], const u_char *m, size_t inlen, 17 17 const u_char key[POLY1305_KEYLEN]) 18 - __bounded((__minbytes__, 1, POLY1305_TAGLEN)) 19 - __bounded((__buffer__, 2, 3)) 20 - __bounded((__minbytes__, 4, POLY1305_KEYLEN)); 18 + __attribute__((__bounded__(__minbytes__, 1, POLY1305_TAGLEN))) 19 + __attribute__((__bounded__(__buffer__, 2, 3))) 20 + __attribute__((__bounded__(__minbytes__, 4, POLY1305_KEYLEN))); 21 21 22 22 #endif /* POLY1305_H */
+2 -2
usr.bin/ssh/ssh-pkcs11.c
··· 1 - /* $OpenBSD: ssh-pkcs11.c,v 1.12 2014/03/26 04:55:35 djm Exp $ */ 1 + /* $OpenBSD: ssh-pkcs11.c,v 1.13 2014/05/02 03:27:54 djm Exp $ */ 2 2 /* 3 3 * Copyright (c) 2010 Markus Friedl. All rights reserved. 4 4 * ··· 377 377 */ 378 378 static int pkcs11_fetch_keys_filter(struct pkcs11_provider *, CK_ULONG, 379 379 CK_ATTRIBUTE [], CK_ATTRIBUTE [3], Key ***, int *) 380 - __bounded((__minbytes__,4, 3 * sizeof(CK_ATTRIBUTE))); 380 + __attribute__((__bounded__(__minbytes__,4, 3 * sizeof(CK_ATTRIBUTE)))); 381 381 382 382 static int 383 383 pkcs11_fetch_keys(struct pkcs11_provider *p, CK_ULONG slotidx,