Closed
Bug 275690
Opened 20 years ago
Closed 18 years ago
NSS + NSPR - Error code + library
Categories
(NSS :: Libraries, defect)
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: jorelia, Unassigned)
Details
Hello,
By using NSS and NSPR, I got the following error -8192 and try to get the error
message but it (PR_GetErrorText) returns nothing. Here is the code involved.
1) PROBLEM
===========
rv1 = PK11_CipherOp( EncContext
, outbuf
, &tmp1_outlen
, sizeof outbuf
, inbuf
, inbuflen );
if (rv1 != SECSuccess )
{
PRErrorCode x = PR_GetError();
char errText[2048];
PR_GetErrorText(&errText[0]);
cout << "cannot decrypt:" << x << "\n";
}
2) Problem
==========
I'm trying to use this API found in header file, but the linker didn't find it !
EncContext = PK11_CreateContextByRawKey( slot, CKM_DES_CBC_PAD,
PK11_OriginUnwrap, CKA_DECRYPT, &ivItem, NULL, NULL );
However I find in nss3.lib those information...
_PK11_CreateContextBySymKey
__imp__PK11_CreateContextBySymKey
___PK11_CreateContextByRawKey
__imp____PK11_CreateContextByRawKey
3) Problem
===========
I don't know to find the documentation about NSS API that really explains all,
how it is working. Do you know a good link?
More over, I'm trying the use DES, by using a raw key but your samples are cool
but not enough. Because I need to read a encrypted data from a tierce party but
there is no documentation about what are the steps for DES encryption, what are
the points to check or to be awared, etc... AS I'm not expert in this field, I
missing something....
Well, anyway, I used Win2000 machine, with MS-Visual C++ V 7.1.3088, .NET
1.1.4322 SP1.
Please, write me directly I you have any answer about this above points. If you
need more stuff, just contact me.
Jorelia.| Reporter | ||
Updated•20 years ago
|
Version: 3.8.3 → 3.9
| Reporter | ||
Comment 1•20 years ago
|
||
4) I would like to know also if it possible to deal with double byte characteres because I think the problem comes from interoperability because .NEt and JAVA platform encrypt data based on double byte key and IV parameters ? Does your NSS is double byte compatible ? because many of your prototye are char* but not wchar_t * or something equivalent ? Did you test for interoperability ? Many thanks for your answer! Jorelia .J. A.
| Reporter | ||
Comment 2•20 years ago
|
||
And a last thing, could you produce debug file for MS Visual C++ V7.1 because under this version we don't have MSVCRTD.DLL, I think that microsoft rename it. Thanks a lot PS: please read at http://support.microsoft.com/default.aspx?scid=KB;en-us;q259403 http://www.dotnet247.com/247reference/msgs/1/7824.aspx http://whidbey.msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_core_c_run.2d.time_debug_libraries.asp
| Reporter | ||
Comment 3•20 years ago
|
||
Just also not, for your information, here is all msvcrt on my machine...
Probably, just correct the path will help me.
C:\Program Files\Adobe\Acrobat 5.0\Acrobat\System\Msvcrt10.dll
C:\Program Files\Adobe\Acrobat 5.0\Acrobat\System\Msvcrt20.dll
C:\Program Files\Adobe\Acrobat 5.0\Acrobat\System\Msvcrt40.dll
A C:\Program Files\CRT\Msvcrt.dll
A C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib\msvcrt.lib
A C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib\msvcrtd.lib
A C:\Program Files\Oracle\jre\1.1.7\bin\msvcrt.dll
A C:\Programs\bea\jdk141_05\jre\bin\msvcrt.dll
C:\WINNT\ServicePackFiles\i386\msvcrt.dll
A C:\WINNT\system32\dllcache\msvcrt20.dll
A C:\WINNT\system32\dllcache\msvcrt40.dll
A C:\WINNT\system32\msvcrt.dll
A C:\WINNT\system32\msvcrt20.dll
A C:\WINNT\system32\msvcrt40.dll
| Reporter | ||
Comment 4•20 years ago
|
||
I would like to add the following comments. I know why the error code returns -
8192. It seems that because the input encrypted data is not a power of 8. My
data length was 12 instead to be 8, 16, 24, 32,....
The reason of having a data length at 12 characters was because the data are
Base64 encoded that produces a string of 12 length from an encrypted string of 8
characters. Well, well, it would be cool if in your documentation to say clearly
that the input data length MUST be a power of 8 and user must be awared that
some encrypted data may be Base64 encoded if they "fly" over the Internet. So
before uncrypted them data shound be unencoded base64. For newbies, it would be
very cool.
More over, you should talk also in term of operability between different OS and
IDE, in my case, it is a JAVA API or a DOT.NET application that encryptes the
data BUT it is a C++ application that reads them. So, as you know, C++ string
MUST terminated by NULL (0x00) characters. So what is the best way to allow a
C++ string like when it is a JAVA or DOT.NET API that wrote and encrypted the data?
I ask you the question because the function ATOB_AsciiToData returns the length
of 8 characters, which is good but the encrypted data is only long of 4 ("test"
in my case) and it was padded to 8 by the cipher function. So, actually I
haven't no way to know where the string ends really in C++!!! The 4 remaind
characters have the value 0x04.... can we do something this that because the
input caracteres cannot be lower that the ASCII TABLE range 0x20 to 0x7E....
Note for the MVCRTD.DLL, I've downloaded from the next, it may be cool to have a
place where developer can get it. I found it at this place : www.dll-files.com
See you and if you have an answer to this problem, I would appreciate some hints!
Merry Christmas and Thank you for NSS and NSPR code, very cool because it is
Xplatform!
Jorelia J. Andre
Updated•20 years ago
|
QA Contact: bishakhabanerjee → jason.m.reid
Updated•19 years ago
|
Assignee: wtchang → nobody
QA Contact: jason.m.reid → libraries
Comment 5•18 years ago
|
||
Sorry, there's no NSS bug being reported here. Documentation is now on a wikki, so documentation suggestions can be self-implemented.
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•