Example #1
0
#include <openssl/evp.h>
#endif /* USING_WOLFSSL */

#include "sshbuf.h"
#include "ssh2.h"
#include "sshkey.h"
#include "cipher.h"
#include "kex.h"
#include "log.h"
#include "digest.h"
#include "ssherr.h"

#ifndef USING_WOLFSSL
extern int crypto_scalarmult_curve25519(u_char a[CURVE25519_SIZE],
    const u_char b[CURVE25519_SIZE], const u_char c[CURVE25519_SIZE])
	__attribute__((__bounded__(__minbytes__, 1, CURVE25519_SIZE)))
	__attribute__((__bounded__(__minbytes__, 2, CURVE25519_SIZE)))
	__attribute__((__bounded__(__minbytes__, 3, CURVE25519_SIZE)));
#endif /* USING_WOLFSSL */

void
kexc25519_keygen(u_char key[CURVE25519_SIZE], u_char pub[CURVE25519_SIZE])
{
#ifdef USING_WOLFSSL
    int ret, psize = CURVE25519_SIZE, ksize = CURVE25519_SIZE;

    ret = wolfSSL_EC25519_generate_key(key, &ksize, pub, &psize);
    if (ret != 1 || ksize != CURVE25519_SIZE || psize != CURVE25519_SIZE)
        fatal("%s: wolfSSL_EC25519_generate_key failed (%d,%d,%d)",
              __func__, ret, ksize, psize);
#else
Example #2
0
// RUN: %clang_cc1 -fsyntax-only %s
// Make sure OpenBSD's bounded extension is accepted.

typedef long ssize_t;
typedef unsigned long size_t;
typedef struct FILE FILE;

ssize_t read(int, void *, size_t)
    __attribute__((__bounded__(__buffer__,2,3)));
int readlink(const char *, char *, size_t)
    __attribute__((__bounded__(__string__,2,3)));
size_t fread(void *, size_t, size_t, FILE *)
    __attribute__((__bounded__(__size__,1,3,2)));
char *getwd(char *)
    __attribute__((__bounded__(__minbytes__,1,1024)));
Example #3
0
// PR c++/46803

int strftime(char *, int, const char *, const struct tm *)
        __attribute__ ((__bounded__(__string__,1,2))); // { dg-warning "ignored" }
Example #4
0
void my_func(char *, int)
	__attribute__((__bounded__(__minbytes__,1,1024)));

int main(int argc, char **argv) {
	return 1;
}
Example #5
0
void my_func(char *, int)
	__attribute__((__bounded__(__string__,1,2)));

int main(int argc, char **argv) {
	return 1;
}