diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2001-06-15 16:57:20 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2001-06-15 16:57:20 +0000 |
commit | 6bbad670fc75632fd03a9cf56dc5e0ce6a196d4c (patch) | |
tree | c7b902dd3c26dc5c73e72d651084adb884b5ad31 /lib/gnutls_datum.c | |
parent | 962ec6bdec17f6fea0603f50bcd418f5e4d0b01d (diff) | |
download | gnutls-6bbad670fc75632fd03a9cf56dc5e0ce6a196d4c.tar.gz |
several additions in order to support KX_RSA and X509PKI.
Diffstat (limited to 'lib/gnutls_datum.c')
-rw-r--r-- | lib/gnutls_datum.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/gnutls_datum.c b/lib/gnutls_datum.c new file mode 100644 index 0000000000..8e137dcb18 --- /dev/null +++ b/lib/gnutls_datum.c @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2001 Nikos Mavroyanopoulos + * + * This file is part of GNUTLS. + * + * GNUTLS is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GNUTLS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#include <defines.h> +#include <gnutls_int.h> +#include <gnutls_num.h> +#include <gnutls_datum.h> +#include <gnutls_errors.h> + +void WRITEdatum16( opaque* dest, gnutls_datum dat) { + WRITEuint16( dat.size, dest); + memcpy( &dest[2], dat.data, dat.size); +} +void WRITEdatum24( opaque* dest, gnutls_datum dat) { + WRITEuint24( dat.size, dest); + memcpy( &dest[3], dat.data, dat.size); +} +void WRITEdatum32( opaque* dest, gnutls_datum dat) { + WRITEuint32( dat.size, dest); + memcpy( &dest[4], dat.data, dat.size); +} +void WRITEdatum8( opaque* dest, gnutls_datum dat) { + dest[0] = (uint8) dat.size; + memcpy( &dest[1], dat.data, dat.size); +} |