fix indention
This commit is contained in:
parent
fd71f42744
commit
239ac917bf
1 changed files with 22 additions and 22 deletions
|
@ -247,30 +247,30 @@ main(int argc, char **argv)
|
||||||
fclose(kfile);
|
fclose(kfile);
|
||||||
|
|
||||||
while ((ptr = read_challenge(stdin))[0] != '\0') {
|
while ((ptr = read_challenge(stdin))[0] != '\0') {
|
||||||
ndata = base64_decode(ptr, strlen((char *)ptr), &len);
|
ndata = base64_decode(ptr, strlen((char *)ptr), &len);
|
||||||
if (ndata == NULL)
|
if (ndata == NULL)
|
||||||
{
|
{
|
||||||
puts("Error: Bad challenge.");
|
puts("Error: Bad challenge.");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((len = RSA_private_decrypt(len, (unsigned char*)ndata,
|
if ((len = RSA_private_decrypt(len, (unsigned char*)ndata,
|
||||||
(unsigned char*)ddata, rsa, RSA_PKCS1_OAEP_PADDING)) == -1)
|
(unsigned char*)ddata, rsa, RSA_PKCS1_OAEP_PADDING)) == -1)
|
||||||
{
|
{
|
||||||
puts("Error: Decryption error.");
|
puts("Error: Decryption error.");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
SHA1_Init(&ctx);
|
SHA1_Init(&ctx);
|
||||||
SHA1_Update(&ctx, (unsigned char *)ddata, len);
|
SHA1_Update(&ctx, (unsigned char *)ddata, len);
|
||||||
SHA1_Final((unsigned char *)ddata, &ctx);
|
SHA1_Final((unsigned char *)ddata, &ctx);
|
||||||
ndata = base64_encode((unsigned char *)ddata, SHA_DIGEST_LENGTH);
|
ndata = base64_encode((unsigned char *)ddata, SHA_DIGEST_LENGTH);
|
||||||
if(isatty(fileno(stdin)))
|
if(isatty(fileno(stdin)))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Response: /quote CHALLENGE +");
|
fprintf(stderr, "Response: /quote CHALLENGE +");
|
||||||
}
|
}
|
||||||
puts((char *)ndata);
|
puts((char *)ndata);
|
||||||
fflush(NULL);
|
fflush(NULL);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue