File: sshcryptotest.c

package info (click to toggle)
tinyssh 20230101-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,244 kB
  • sloc: ansic: 12,106; sh: 1,168; python: 479; makefile: 42
file content (55 lines) | stat: -rw-r--r-- 1,092 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
20140417
Jan Mojzis
Public domain.
*/

#include <unistd.h>
#include "sshcrypto.h"

/* grep "define sshcrypto_" source/tinyssh/sshcrypto.h | cut -d ' ' -f2  |  while read x; do echo \#ifndef $x; echo error! ;echo \#endif; done */

#ifndef sshcrypto_kem_PUBLICKEYMAX
error!
#endif
#ifndef sshcrypto_kem_CIPHERTEXTMAX
error!
#endif
#ifndef sshcrypto_kem_MAX
error!
#endif
#ifndef sshcrypto_hash_MAX
error!
#endif
#ifndef sshcrypto_sign_PUBLICKEYMAX
error!
#endif
#ifndef sshcrypto_sign_SECRETKEYMAX
error!
#endif
#ifndef sshcrypto_sign_MAX
error!
#endif
#ifndef sshcrypto_sign_BASE64PUBLICKEYMAX
error!
#endif
#ifndef sshcrypto_sign_BASE64PUBLICKEYMIN
error!
#endif
#ifndef sshcrypto_cipher_KEYMAX
error!
#endif

int main(void) {

    /* check sshcrypto_init() called called more than once */
    sshcrypto_init();
    sshcrypto_init();
    /* check sshcrypto_purge() called called more than once */
    sshcrypto_purge();
    sshcrypto_purge();
    /* check sshcrypto_init() called called more than once after sshcrypto_purge() */
    sshcrypto_init();
    sshcrypto_init();
    _exit(0);
}