--- rsaref/source/r_encode.c 2018/04/24 16:37:52 1.1 +++ rsaref/source/r_encode.c 2018/04/24 16:38:02 1.1.1.2 @@ -1,13 +1,12 @@ -/* R_ENCODE.H - RFC 1113 encoding and decoding routines +/* R_ENCODE.C - RFC 1113 encoding and decoding routines */ -/* Copyright (C) 1991-2 RSA Laboratories, a division of RSA Data - Security, Inc. All rights reserved. +/* Copyright (C) RSA Laboratories, a division of RSA Data Security, + Inc., created 1991. All rights reserved. */ #include "global.h" #include "rsaref.h" -#include "r_encode.h" /* RFC 1113 encoding: @@ -58,7 +57,9 @@ static void EncodeLastQuantum static int DecodeLastQuantum PROTO_LIST ((unsigned char *, unsigned int *, unsigned char [4])); -void R_EncodePEMBlock (encodedBlock, encodedBlockLen, block, blockLen) +/* This always returns 0. It is an int function for future compatibility. + */ +int R_EncodePEMBlock (encodedBlock, encodedBlockLen, block, blockLen) unsigned char *encodedBlock; /* encoded block */ unsigned int *encodedBlockLen; /* length of encoded block */ unsigned char *block; /* block */ @@ -68,7 +69,7 @@ unsigned int blockLen; if (blockLen < 1) { *encodedBlockLen = 0; - return; + return (0); } for (i = 0; i < (blockLen-1)/3; i++) @@ -77,6 +78,8 @@ unsigned int blockLen; lastLen = blockLen - 3*i; EncodeLastQuantum (&encodedBlock[4*i], &block[3*i], lastLen); *encodedBlockLen = 4*i + 4; + + return (0); } int R_DecodePEMBlock (block, blockLen, encodedBlock, encodedBlockLen)