2
* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2008 Free Software Foundation
2
* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2008, 2010 Free Software
4
5
* Author: Nikos Mavrogiannopoulos
6
* This file is part of GNUTLS.
7
* This file is part of GnuTLS.
8
* The GNUTLS library is free software; you can redistribute it and/or
9
* The GnuTLS is free software; you can redistribute it and/or
9
10
* modify it under the terms of the GNU Lesser General Public License
10
11
* as published by the Free Software Foundation; either version 2.1 of
11
12
* the License, or (at your option) any later version.
313
* gnutls_srp_base64_encode - Encode raw data using SRP-Base64
314
* @data: contain the raw data
315
* @result: the place where base64 data will be copied
316
* @result_size: holds the size of the result
318
* This function will convert the given data to printable data, using
319
* the base64 encoding, as used in the libsrp. This is the encoding
320
* used in SRP password files. If the provided buffer is not long
321
* enough GNUTLS_E_SHORT_MEMORY_BUFFER is returned.
323
* Warning! This base64 encoding is not the "standard" encoding, so
324
* do not use it for non-SRP purposes.
326
* Returns: %GNUTLS_E_SHORT_MEMORY_BUFFER if the buffer given is not
327
* long enough, or 0 on success.
314
* gnutls_srp_base64_encode:
315
* @data: contain the raw data
316
* @result: the place where base64 data will be copied
317
* @result_size: holds the size of the result
319
* This function will convert the given data to printable data, using
320
* the base64 encoding, as used in the libsrp. This is the encoding
321
* used in SRP password files. If the provided buffer is not long
322
* enough GNUTLS_E_SHORT_MEMORY_BUFFER is returned.
324
* Warning! This base64 encoding is not the "standard" encoding, so
325
* do not use it for non-SRP purposes.
327
* Returns: %GNUTLS_E_SHORT_MEMORY_BUFFER if the buffer given is not
328
* long enough, or 0 on success.
330
331
gnutls_srp_base64_encode (const gnutls_datum_t * data, char *result,
331
332
size_t * result_size)
357
* gnutls_srp_base64_encode_alloc - encode raw data using SRP-Base64
358
* @data: contains the raw data
359
* @result: will hold the newly allocated encoded data
361
* This function will convert the given data to printable data, using
362
* the base64 encoding. This is the encoding used in SRP password
363
* files. This function will allocate the required memory to hold
366
* You should use gnutls_free() to free the returned data.
368
* Warning! This base64 encoding is not the "standard" encoding, so
369
* do not use it for non-SRP purposes.
371
* Returns: 0 on success, or an error code.
358
* gnutls_srp_base64_encode_alloc:
359
* @data: contains the raw data
360
* @result: will hold the newly allocated encoded data
362
* This function will convert the given data to printable data, using
363
* the base64 encoding. This is the encoding used in SRP password
364
* files. This function will allocate the required memory to hold
367
* You should use gnutls_free() to free the returned data.
369
* Warning! This base64 encoding is not the "standard" encoding, so
370
* do not use it for non-SRP purposes.
372
* Returns: 0 on success, or an error code.
374
375
gnutls_srp_base64_encode_alloc (const gnutls_datum_t * data,
375
376
gnutls_datum_t * result)
399
* gnutls_srp_base64_decode - decode SRP-base64 encoded data
400
* @b64_data: contain the encoded data
401
* @result: the place where decoded data will be copied
402
* @result_size: holds the size of the result
404
* This function will decode the given encoded data, using the base64
405
* encoding found in libsrp.
407
* Note that b64_data should be null terminated.
409
* Warning! This base64 encoding is not the "standard" encoding, so
410
* do not use it for non-SRP purposes.
412
* Returns: %GNUTLS_E_SHORT_MEMORY_BUFFER if the buffer given is not
413
* long enough, or 0 on success.
400
* gnutls_srp_base64_decode:
401
* @b64_data: contain the encoded data
402
* @result: the place where decoded data will be copied
403
* @result_size: holds the size of the result
405
* This function will decode the given encoded data, using the base64
406
* encoding found in libsrp.
408
* Note that @b64_data should be null terminated.
410
* Warning! This base64 encoding is not the "standard" encoding, so
411
* do not use it for non-SRP purposes.
413
* Returns: %GNUTLS_E_SHORT_MEMORY_BUFFER if the buffer given is not
414
* long enough, or 0 on success.
416
417
gnutls_srp_base64_decode (const gnutls_datum_t * b64_data, char *result,
417
418
size_t * result_size)
443
* gnutls_srp_base64_decode_alloc - decode SRP-base64 encoded data
444
* @b64_data: contains the encoded data
445
* @result: the place where decoded data lie
447
* This function will decode the given encoded data. The decoded data
448
* will be allocated, and stored into result. It will decode using
449
* the base64 algorithm as used in libsrp.
451
* You should use gnutls_free() to free the returned data.
453
* Warning! This base64 encoding is not the "standard" encoding, so
454
* do not use it for non-SRP purposes.
456
* Returns: 0 on success, or an error code.
444
* gnutls_srp_base64_decode_alloc:
445
* @b64_data: contains the encoded data
446
* @result: the place where decoded data lie
448
* This function will decode the given encoded data. The decoded data
449
* will be allocated, and stored into result. It will decode using
450
* the base64 algorithm as used in libsrp.
452
* You should use gnutls_free() to free the returned data.
454
* Warning! This base64 encoding is not the "standard" encoding, so
455
* do not use it for non-SRP purposes.
457
* Returns: 0 on success, or an error code.
459
460
gnutls_srp_base64_decode_alloc (const gnutls_datum_t * b64_data,
460
461
gnutls_datum_t * result)