{"id":4068,"date":"2022-01-12T17:09:18","date_gmt":"2022-01-12T17:09:18","guid":{"rendered":"https:\/\/nenadnoveljic.com\/blog\/?p=4068"},"modified":"2022-01-27T14:06:09","modified_gmt":"2022-01-27T14:06:09","slug":"ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog","status":"publish","type":"post","link":"https:\/\/nenadnoveljic.com\/blog\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\/","title":{"rendered":"ORA-12269: client uses weak encryption\/crypto-checksumming version when creating CDB catalog"},"content":{"rendered":"<h1>CDB catalog<\/h1>\n<p>We were ocassionally hitting &#8220;ORA-12269: client uses weak encryption\/crypto-checksumming version&#8221; when creating CDB catalog with catcdb.sql script on Oracle database releases 19.13, 21.3 and 21.4 running on Oracle Linux 8.4. It wasn&#8217;t clear which operation was failing, because catcdb.sql had already deleted all the useful information. In order to obtain diagnostic information, we first analyzed how Oracle creates CDB catalog.<\/p>\n<h1>catcdb.sql<\/h1>\n<p>The following call to catcdb.sql creates a CDB catalog:<\/p>\n<pre><code>@?\/rdbms\/admin\/catcdb.sql '\/u00\/oracle\/orabase\/admin\/DB\/create' 'catcdb.log'<\/code><\/pre>\n<p>catcdb.sql basically just calls the Perl program catcdb.pl:<\/p>\n<pre><code>\n...\ncolumn rdbms_admin_catcdb new_value rdbms_admin_catcdb noprint\nselect '&amp;&amp;rdbms_admin'||'&amp;&amp;slash'||'catcdb.pl' as rdbms_admin_catcdb from dual;\n\nhost perl -I &amp;&amp;rdbms_admin &amp;&amp;rdbms_admin_catcdb --logDirectory &amp;&amp;1 --logFilename &amp;&amp;2\n<\/code><\/pre>\n<h1>catcdb.pl<\/h1>\n<p>The Perl program catcdb.pl creates the catalog by calling a series of SQL scripts. SQL Scripts are stored in an array of hash pointers:<\/p>\n<pre><code>\nmy @START_SCRIPTS = (\n                     {\n                      LOG_FILENAME_OPT =&gt; 'catalog',\n                      SCRIPT_COMMAND_OPT =&gt; sub { return 'catalog.sql' },\n                      USERNAME_OPT =&gt; SYS_USER,\n                      SCRIPT_DIRECTORY_OPT =&gt; $rdbms_admin,\n                     },\n                     {\n                      LOG_FILENAME_OPT =&gt; 'catproc',\n                      SCRIPT_COMMAND_OPT =&gt; sub { return 'catproc.sql' },\n                      USERNAME_OPT =&gt; SYS_USER,\n                      SCRIPT_DIRECTORY_OPT =&gt; $rdbms_admin,\n                     },\n                     {\n                      LOG_FILENAME_OPT =&gt; 'catoctk',\n                      SCRIPT_COMMAND_OPT =&gt; sub { return 'catoctk.sql '},\n                      USERNAME_OPT =&gt; SYS_USER,\n                      SCRIPT_DIRECTORY_OPT =&gt; $rdbms_admin,\n                     },\n                     {\n                      LOG_FILENAME_OPT =&gt; 'owminst',\n                      SCRIPT_COMMAND_OPT =&gt; sub { return 'owminst.plb' },\n                      USERNAME_OPT =&gt; SYS_USER,\n                      SCRIPT_DIRECTORY_OPT =&gt; $rdbms_admin,\n                     },\n...\n<\/code><\/pre>\n<p>catcdb.pl iterates through the array START_SCRIPTS and executes the configured scripts. Unfortunately, it neither parses the log files nor does it stop processing on error. Consequently, it deletes all the diagnostic information. So I was looking for a way to interrupt processing on error.<\/p>\n<p>catcdb.pl calls catcon.pl which, in turn, imports functions from the Perl module catcon.pm. One of those functions calls sqlplus to execute catalog scripts.<\/p>\n<h1>catcon.pm<\/h1>\n<p>The function exec_DB_script is the central function that executes generated SQL scripts.<\/p>\n<h2>exec_DB_script arguments<\/h2>\n<p>There is an anomaly in this function, though, not related to our issue. I decided to include the information anyway.<\/p>\n<p>The last parameter is the path to the <span style=\"color:red\">sqlplus<\/span> and is stored in the variable <span style=\"color:blue\">$sqlplus<\/span>.<\/p>\n<pre><code>\nsub exec_DB_script (\\@$) {\n  my ($statements, $marker, $DoneCmd, $DoneFilePathBase, <span style=\"color:blue\">$sqlplus<\/span>) = @_;\n<\/code><\/pre>\n<p>But the <span style=\"color:blue\">$sqlplus<\/span> variable is never used. Below is the call to <span style=\"color:red\">sqlplus<\/span>:<\/p>\n<pre><code>  open my $Reader, \"<span style=\"color:red\">sqlplus<\/span> \/nolog \\@$scriptFile | \";<\/code><\/pre>\n<p>&#8220;$&#8221; is missing in front of sqlplus. In Perl <span style=\"color:blue\">$sqlplus<\/span> is the value of the variable called <span style=\"color:blue\">$sqlplus<\/span> and <span style=\"color:red\">sqlplus<\/span> is just a string:<\/p>\n<pre><code>my <span style=\"color:blue\">$sqlplus<\/span> = \"\/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\" ;\nprint \"variable: <span style=\"color:blue\">$sqlplus<\/span> \\n\" ;\nprint \"string:    <span style=\"color:red\">sqlplus<\/span> \\n\" ;<\/code><\/pre>\n<pre><code>perl demo.pl\nvariable: <span style=\"color:blue\">\/u00\/oracle\/orabase\/product\/21.3.0.0.0_a<\/span>\nstring:    <span style=\"color:red\">sqlplus<\/span><\/code><\/pre>\n<p>The sqlplus path passed through the function argument was ignored and the sqlplus was resolved through the PATH variable. Since PATH was set correctly, the correct sqlplus was picked up, so it doesn&#8217;t make a difference in this case.<\/p>\n<h2>Interrupting exec_DB_script<\/h2>\n<p>Our goal was to check the environment and find out the command in the script where the problem happened. Therefore, I introduced the following code in the procedure exec_DB_script in the while loop that parses the output (I did those changes in the lab environment):<\/p>\n<pre><code>if ( $_ =~ m{ORA-12269} ) {\nopen(FH, '&gt;', '\/tmp\/failed_' . time );\nprint FH \"$scriptFile \\n\" ;\nprint FH \"$ENV{PATH}\\n\" ;\nprint FH \"$ENV{LD_LIBRARY_PATH}\\n\" ;\nprint FH join \"\\n\", @Spool ;\nclose FH ;\ndie \"Killed\" ;\n}<\/code><\/pre>\n<p>The code above spools the environment and stops the execution. After the execution stopped we examined the scripts and outputs in the working directory. The error was raised while establishing connection.<\/p>\n<pre><code>connect sys\/\"manager\" as sysdba<\/code><\/pre>\n<p>Notice that this connection string produces a local connection with OS authentication. As long as you specify &#8220;as sysdba&#8221; and don&#8217;t specify the TNS connect string, you can provide any username and password:<\/p>\n<pre><code>sqlplus <span style=\"color:red\">non-existing-user\/invalid_password<\/span> as sysdba\n\nSQL*Plus: Release 19.0.0.0.0 - Production on Wed Jan 12 13:27:10 2022\nVersion 19.13.0.0.0\n\nCopyright (c) 1982, 2021, Oracle.  All rights reserved.\n\n\n<span style=\"color:red\">Connected<\/span> to:\nOracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production\nVersion 19.13.0.0.0\n\nSQL&gt;<\/code><\/pre>\n<p>This is expected behavior, documented in the MOS note &#8220;Why Can I Login AS SYSDBA With Any Username and Password? (Doc ID 242258.1)&#8221;:<\/p>\n<p>connect sys\/&#8221;manager&#8221; as sysdba worked fine. Just when we ran it in a loop for a while, the error was raised. In contrast, we couldn&#8217;t reproduce the error with the usual connect string &#8220;\/ as sysdba&#8221;.<\/p>\n<h1>Call Stack<\/h1>\n<p>We configured the event to gather the call stack on the error, which should provide a context where the error was generated:<\/p>\n<pre><code>event='12269 TRACE NAME ERRORSTACK LEVEL 3'<\/code><\/pre>\n<pre><code>kgerelv()+137        call     kgeade()             7F1FE0CB59C0 ? 7F1FE0CB5C08 ?\n                                                   7F1FE0B50050 ? 000002FED ?\n                                                   000000000 000000000\nkserecl0()+189       call     kgerelv()            7F1FE0CB59C0 ? 7F1FE0B50050 ?\n                                                   7F1FE0B50050 ? 0134B62F0 ?\n                                                   000000000 ? 000000000 ?\n<span style=\"color:red\">ksulbem<\/span>()+454        call     kserecl0()           7F1FE0CB59C0 ? 7F1FE0B50050 ?\n                                                   7F1FE0B50050 ? 0000007FF\n                                                   000000000 006E9AD80\nopitsk()+3292        call     ksulbem()            000000001 ? 000002FED ?\n                                                   7FFFBA5E3C20 ? 0000007FF ?\n                                                   000000000 ? 006E9AD80 ?\nopiino()+936         call     opitsk()             000000000 000000000\n                                                   7FFFBA5E3C20 ? 0000007FF ?\n                                                   000000000 ? 006E9AD80 ?\n<\/code><\/pre>\n<p>The lower functions on the stack beginning with &#8220;kge&#8221; and &#8220;kse&#8221; handle errors. Prima vista, the error seems to originate from <span style=\"color:red\">ksulbem<\/span>, which according to its naming convention shouldn&#8217;t have anything to do with error handling. ksulbem was called by opitsk, a generic function for handling local connections.<\/p>\n<p>Since nobody outside Oracle seems to know about the purpose of this function, <a href=\"https:\/\/www.freelists.org\/post\/oracle-l\/catcdbsql-fails-with-ORA12269-client-uses-weak-encryptioncryptochecksumming-version,13\">Stefan Koehler suggested tracing with Intel pin debugtrace<\/a>.<\/p>\n<p>By running debugtrace on sqlplus in a loop, we managed to capture the trace of a failed connection.<\/p>\n<pre><code>.\/pin -follow_execv -t source\/tools\/DebugTrace\/obj-intel64\/debugtrace.so -- sqlplus sys\/\"manager\" as sysdba<\/code><\/pre>\n<pre><code>\nCall \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:opitsk+0x00000000170f -&gt; 0x00000000149e7a80 \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:<span style=\"color:red\">ksulbem<\/span>(0x1, <span style=\"color:red\">0x2fed<\/span>, ...)\n| Call 0x00000000149e7c41 \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:ksulbem+0x0000000001c1 -&gt; 0x0000000000ea35a0 \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:kserecl0(0x15a279c0, 0x15a279d4, ...)\n<\/code><\/pre>\n<p>Pay attention to the second argument of <span style=\"color:red\">ksulbem<\/span>: <span style=\"color:red\">0x2fed<\/span>. <span style=\"color:red\">0x2fed<\/span> is <span style=\"color:red\">12269<\/span> in decimal notation, which is our error code! Since the error code was passed to ksulbem, the error was not generated inthere. In other words, ksulbem is just an error handling function (&#8220;em&#8221; might stand for &#8220;error management&#8221;).<\/p>\n<p>The error was generated before, in the function <span style=\"color:red\">naedacc<\/span>, when reading incoming packets:<\/p>\n<pre><code>\nCall 0x0000000014419a71 \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:nsfull_pkt_rcv+0x0000000046f1 -&gt; 0x00000000144d8870 \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:naedacc(0x7ff1d79e4058, 0x7ff1d79e12e0, ...)\nReturn 0x00000000144d91d8 \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:<span style=\"color:red\">naedacc<\/span>+0x000000000968 returns: <span style=\"color:red\">0x2fed<\/span>\nCall 0x0000000014419afc \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:nsfull_pkt_rcv+0x00000000477c -&gt; 0x0000000006e32d40 \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:nserrbc(0x7ff1d79df928, 0, ...)\n<\/code><\/pre>\n<p>nsfull_pkt_rcv called <span style=\"color:red\">naedacc<\/span>. <span style=\"color:red\">naedacc<\/span> is one of the functions handling encryption\/decryption. It seems to be short-circuited &#8211; it exited quickly, without calling any other functions. Presumably, it found something in the byte stream that misled it to the wrong conclusion that weak ciphers are being used. As a result, it returned the error code <span style=\"color:red\">0x2fed<\/span>.<\/p>\n<p>This is how the <span style=\"color:red\">naedacc<\/span> stack looks like for a good execution (the indentation removed to improve the readability):<\/p>\n<pre><code>.\/pin -follow_execv -t source\/tools\/DebugTrace\/obj-intel64\/debugtrace.so -- sqlplus sys\/\"manager\" as sysdba<\/code><\/pre>\n<pre><code>Call 0x00000000144d8a4e \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:<span style=\"color:red\">naedacc<\/span>+0x0000000001de -&gt; 0x00000000143420a0 \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:naeaesd(0x7fcd39987c38, 0x7fcd399812e0, ...)\nCall 0x00000000143420ee \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:naeaesd+0x00000000004e -&gt; 0x0000000014faa9c0 \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:ssMemMalloc(0x31, 0x7fcd399812e0, ...)\nTailcall 0x0000000014faa9d5 \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:ssMemMalloc+0x000000000015 -&gt; 0x00000000149ffca0 \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:ksmem_malloc(0x31, 0x7fcd399812e0, ...)\nReturn 0x00000000149ffe62 \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:ksmem_malloc+0x0000000001c2 returns: 0x7fcd3997f730\nCall 0x000000001434211d \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:naeaesd+0x00000000007d -&gt; 0x0000000006fa8480 \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:<span style=\"color:red\">ztcedec<\/span>(0x7008001, 0x7fcd3998cd30, ...)\nCall 0x0000000006fa84a7 \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:<span style=\"color:red\">ztcedec<\/span>+0x000000000027 -&gt; 0x0000000006fa84d0 \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:ztcedec2(0x7008001, 0x7fcd3998cd30, ...)\nTailcall 0x0000000006fa84da \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:<span style=\"color:red\">ztcedec2<\/span>+0x00000000000a -&gt; 0x000000001540f0b0 \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:<span style=\"color:red\">ztcecrypto_2<\/span>(0x7008001, 0x7fcd3998cd30, ...)\nCall 0x000000001540f135 \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:<span style=\"color:red\">ztcecrypto_2<\/span>+0x000000000085 -&gt; 0x000000001540f1f0 \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle:ztcei2(0x7ffede9f0b70, 0x7008001, ...)\n...\n<\/code><\/pre>\n<p>We can see a long list of encryption handling functions (all beginning with &#8220;<span style=\"color:red\">zt<\/span>&#8220;, see <a href=\"http:\/\/orafun.info\/\">Frits Hogland&#8217;s orafun.info<\/a>&#8220;).<\/p>\n<p>How does the program flow look like without encryption?<\/p>\n<p>I&#8217;m setting TNS_ADMIN to a directory without sqlnet.ora (no encryption by default) and starting sqlplus with pin debugtrace:<\/p>\n<pre><code>export TNS_ADMIN=\/tmp\n.\/pin -follow_execv -t source\/tools\/DebugTrace\/obj-intel64\/debugtrace.so -- sqlplus sys\/\"manager\" as sysdba<\/code><\/pre>\n<p>Expectedly, no naedacc call was made:<\/p>\n<pre><code>grep naedacc debugtrace.out<\/code><\/pre>\n<p>We indeed couldn&#8217;t reproduce the problem without encryption.<\/p>\n<h1>Summary<\/h1>\n<p>If you specify username and password despite using OS authentication, you might get &#8220;ORA-12269: client uses weak encryption\/crypto-checksumming version&#8221;. The issue isn&#8217;t reproducible at will. I assume there&#8217;s a boundary condition where a byte in the encrypted stream is wrongly recognized as a flag that marks weak encryption algorithms. Comparing the condition in the function naedacc with the byte stream in SQLNet trace should provide a clue for a bug fix.<\/p>\n<p>Specifying username and password with OS authentication is unnecessary. Therefore, the best way to avoid it to use the connect string without username and password, for example &#8220;\/ as sysdba&#8221;.<\/p>\n<p>CDB catalog creation, however, specifies username and password and may occasionally fail. The workaround consists of pointing TNS_ADMIN to a configuration without encryption before starting sqlplus that will run the catalog creation. Alternatively, you can point it to any directory without sqlnet.ora as encryption is switched off by default.<\/p>\n<h1>Update on January 20, 2022 &#8211; Internals<\/h1>\n<p>Meanwhile, I figured out the flag which triggers the error. I did the analysis on 21.3. The data structure that stores the flag might change with each release.<\/p>\n<p>After logging in with sqlplus, I&#8217;m attaching with gdb to the dedicated server process:<\/p>\n<pre><code>attach 1506475\nAttaching to process 1506475\nReading symbols from \/u00\/oracle\/orabase\/product\/21.3.0.0.0_a\/bin\/oracle...<\/code><\/pre>\n<p>I&#8217;m setting the breakpoint at naedacc:<\/p>\n<pre><code>(gdb) b naedacc\nBreakpoint 1 at 0x144d8870\n(gdb) c\nContinuing.<\/code><\/pre>\n<p>In the SQLPlus I&#8217;m running a query and hitting the breakpoint:<\/p>\n<pre><code>Breakpoint 1, 0x00000000144d8870 in naedacc ()<\/code><\/pre>\n<p>The CPU register contains the pointer to the structure that contains the flag that is tested for raising the error:<\/p>\n<pre><code>(gdb) p\/x <span style=\"color:brown\">$rdi<\/span>\n$1 = <span style=\"color:brown\">0x7fceede60058<\/span><\/code><\/pre>\n<p>The flag is stored in the byte 0x74 of the structure and is set to zero:<\/p>\n<pre><code>(gdb) x\/u <span style=\"color:red\">$rdi+0x74<\/span>\n<span style=\"color:red\">0x7fceede600cc<\/span>: 0<\/code><\/pre>\n<p>How can we verify that we&#8217;re looking at the correct location?<\/p>\n<p>We can set it to a non-zero value and continue with the execution:<\/p>\n<pre><code>(gdb) set *<span style=\"color:red\">0x7fceede600cc<\/span> = 1\n(gdb) x\/u  <span style=\"color:red\">$rdi+0x74<\/span>\n<span style=\"color:red\">0x7fceede600cc<\/span>: 1\n(gdb) c\nContinuing.<\/code><\/pre>\n<p>Setting the flag to a non-zero value indeed causes the error:<\/p>\n<pre><code>SQL&gt; select * from dba_users ;\nselect * from dba_users\n*\nERROR at line 1:\nORA-12269: client uses weak encryption\/crypto-checksumming version<\/code><\/pre>\n<p><a href=\"https:\/\/twitter.com\/OracleSK\/status\/1483878913168314380\">Stefan Koehler suggested using pintools debugtrace with the memory option for finding out who sets this flag<\/a>.<\/p>\n<p>First, we have to find out the flag address in the debugtrace output (the address remains constant for the session, but changes for each connection, when a new dedicated server process is forked.)<\/p>\n<p>Below is the first call to <span style=\"color:blue\">naedacc<\/span> during connection:<\/p>\n<pre><code>21.3.0.0.0_a\/bin\/oracle:nsfull_pkt_rcv+0x0000000046f1 -&gt; 0x00000000144d8870 21.3.0.0.0_a\/\nbin\/oracle:<span style=\"color:blue\">naedacc<\/span>(<span style=\"color:brown\">0x7fb24c76c058<\/span>, 0x7fb24c7692e0, ...)\nWrite *(UINT64*)0x00007ffec34c87a8 = 0x14419a76\nWrite *(UINT64*)0x00007ffec34c87a0 = 0x7ffec34c8c40\nWrite *(UINT64*)0x00007ffec34c8798 = 0x7fb24c756060\nWrite *(UINT64*)0x00007ffec34c8790 = 0x7fb24cef62e8\nWrite *(UINT64*)0x00007ffec34c8788 = 0\nWrite *(UINT64*)0x00007ffec34c8780 = 0x7fb24c759858\nWrite *(UINT64*)0x00007ffec34c8778 = 0x7fb24c767928\nRead 0x7fb24f0f07c8 = *(UINT64*)0x00007fb24c76c070\nRead 0x7fb24cef62e8 = *(UINT64*)0x00007fb24f0f0820\nRead 0x20 = *(UINT8*)0x00007fb24cef62f1\nWrite *(UINT64*)0x00007ffec34c8770 = 0\nRead 0x1 = *(UINT32*)0x00007fb24c76c0c8\nRead 0x7fb24c76e6f0 = *(UINT64*)0x00007fb24c76c230\nRead 0x7fb24c76fcf8 = *(UINT64*)0x00007fb24c76c238\nRead 0x7fb24c76fc38 = *(UINT64*)0x00007fb24c76c240\nRead 0 = *(UINT8*)0x00007fb24c769311\nRead 0x3c = *(UINT64*)0x00007fb24c7562e8\nWrite *(UINT64*)0x00007fb24c7562e8 = 0x3b\nRead 0x7fb24c76c058 = *(UINT64*)0x00007fb24c76e720\nRead 0x1 = *(UINT32*)0x00007fb24c76c060 \nRead 0 = *(UINT8*)0x00007fb24c76eb34\nRead 0 = *(UINT32*)<span style=\"color:red\">0x00007fb24c76c0cc<\/span>\nRead 0x11 = *(UINT8*)0x00007fb24c76fc40\nRead 0 = *(UINT32*)0x00007fb24c76fc70\nRead 0 = *(UINT8*)0x00007fb24c76fc50\nWrite *(UINT64*)0x00007ffec34c8748 = 0x7fb24c76fcf8<\/code><\/pre>\n<p>The pointer to the structure <span style=\"color:brown\">0x7fb24c76c058<\/span> is passed through the first parameter. We know this because the first argument is passed through the RDI CPU register according to the <a href=\"https:\/\/en.wikipedia.org\/wiki\/X86_calling_conventions\">x86 calling convention<\/a>, and we previously verified that the pointer is stored in the RDI register when entering naedacc. The flag is stored on the memory location <span style=\"color:red\">0x00007fb24c76c0cc<\/span> (<span style=\"color:brown\">0x7fb24c76c058<\/span> + 0x74). We can see that a read from this location returned 0.<\/p>\n<p>Next, we have to look in the debugtrace output where this location was set before naedacc call:<\/p>\n<pre><code>Tailcall 0x0000000007c9b024 21.3.0.0.0_a\/bin\/oracle:_intel_fast_memset.V+0x000000000004 -&gt; 0x0000000007ca1fd0 21.3.0.0.0_a\/bin\/oracle:<span style=\"color:blue\">__intel_avx_rep_memset<\/span>(0x7fb24c76c058, 0, ...)\nRead 0x1c0 = *(UINT64*)0x0000000007ca2330\nWrite *(UINT64*)0x00007fb24c76c058 = 0\nRead 0x8000 = *(UINT32*)0x000000001a46f528\nWrite *(UINT256)0x00007fb24c76c060 = 00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000\nWrite *(UINT256)0x00007fb24c76c080 = 00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000\nWrite *(UINT256)0x00007fb24c76c0a0 = 00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000\nWrite *(UINT256)<span style=\"color:red\">0x00007fb24c76c0c0<\/span> = 00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000<\/code><\/pre>\n<p>The function <span style=\"color:blue\">__intel_fast_memset<\/span> is too generic &#8211; we know that it initializes the memory locations, but it doesn&#8217;t tell us anything about the Oracle context. So we have to scroll further up until the next Oracle function:<\/p>\n<pre><code>Call 0x0000000006ede8b7 21.3.0.0.0_a\/bin\/oracle:<span style=\"color:blue\">nainit<\/span>+0x000000000107 -&gt; 0x0000000003e98f70 21.3.0.0.0_a\/bin\/oracle:ssMemCalloc(0x248, 0x1, ...)<\/code><\/pre>\n<p>The Oracle function <span style=\"color:blue\">nainit<\/span> initialized the whole structure. Since after the initialization nobody has changed the flag, it has remained zero when naedacc was called. This means that in case of error, the flag is probably overwritten between nainit and naedacc calls. We need a trace of failed connection. Therefore, I&#8217;m currently running the following command in a loop:<\/p>\n<pre><code>pin -follow_execv -t source\/tools\/DebugTrace\/obj-intel64\/debugtrace.so -- sqlplus sys\/manager as sysdba<\/code><\/pre>\n<p>As pin debugtrace with the memory option is extremely slow, the expected time to error is a couple of weeks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Oracle internals analysis with pintools; workaround provided <a href=\"https:\/\/nenadnoveljic.com\/blog\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\/\" class=\"more-link\">Continue Reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[26,5],"tags":[],"class_list":["post-4068","post","type-post","status-publish","format-standard","hentry","category-encryption","category-oracle"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>ORA-12269: client uses weak encryption\/crypto-checksumming version when creating CDB catalog - All-round Database Topics<\/title>\n<meta name=\"description\" content=\"Oracle internals analysis with pintools; workaround provided\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/nenadnoveljic.com\/blog\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ORA-12269: client uses weak encryption\/crypto-checksumming version when creating CDB catalog - All-round Database Topics\" \/>\n<meta property=\"og:description\" content=\"Oracle internals analysis with pintools; workaround provided\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nenadnoveljic.com\/blog\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\/\" \/>\n<meta property=\"og:site_name\" content=\"All-round Database Topics\" \/>\n<meta property=\"article:published_time\" content=\"2022-01-12T17:09:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-01-27T14:06:09+00:00\" \/>\n<meta name=\"author\" content=\"Nenad Noveljic\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@NenadNoveljic\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nenad Noveljic\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\\\/\"},\"author\":{\"name\":\"Nenad Noveljic\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#\\\/schema\\\/person\\\/51458d9dd86dbbdd19f5add451d44efa\"},\"headline\":\"ORA-12269: client uses weak encryption\\\/crypto-checksumming version when creating CDB catalog\",\"datePublished\":\"2022-01-12T17:09:18+00:00\",\"dateModified\":\"2022-01-27T14:06:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\\\/\"},\"wordCount\":1388,\"commentCount\":3,\"articleSection\":[\"encryption\",\"Oracle\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\\\/\",\"url\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\\\/\",\"name\":\"ORA-12269: client uses weak encryption\\\/crypto-checksumming version when creating CDB catalog - All-round Database Topics\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#website\"},\"datePublished\":\"2022-01-12T17:09:18+00:00\",\"dateModified\":\"2022-01-27T14:06:09+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#\\\/schema\\\/person\\\/51458d9dd86dbbdd19f5add451d44efa\"},\"description\":\"Oracle internals analysis with pintools; workaround provided\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ORA-12269: client uses weak encryption\\\/crypto-checksumming version when creating CDB catalog\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/\",\"name\":\"All-round Database Topics\",\"description\":\"Nenad Noveljic\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#\\\/schema\\\/person\\\/51458d9dd86dbbdd19f5add451d44efa\",\"name\":\"Nenad Noveljic\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g\",\"caption\":\"Nenad Noveljic\"},\"sameAs\":[\"nenad-noveljic-9b746a6\",\"https:\\\/\\\/x.com\\\/NenadNoveljic\"],\"url\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/author\\\/nenad\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ORA-12269: client uses weak encryption\/crypto-checksumming version when creating CDB catalog - All-round Database Topics","description":"Oracle internals analysis with pintools; workaround provided","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/nenadnoveljic.com\/blog\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\/","og_locale":"en_US","og_type":"article","og_title":"ORA-12269: client uses weak encryption\/crypto-checksumming version when creating CDB catalog - All-round Database Topics","og_description":"Oracle internals analysis with pintools; workaround provided","og_url":"https:\/\/nenadnoveljic.com\/blog\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\/","og_site_name":"All-round Database Topics","article_published_time":"2022-01-12T17:09:18+00:00","article_modified_time":"2022-01-27T14:06:09+00:00","author":"Nenad Noveljic","twitter_card":"summary_large_image","twitter_creator":"@NenadNoveljic","twitter_misc":{"Written by":"Nenad Noveljic","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/nenadnoveljic.com\/blog\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\/#article","isPartOf":{"@id":"https:\/\/nenadnoveljic.com\/blog\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\/"},"author":{"name":"Nenad Noveljic","@id":"https:\/\/nenadnoveljic.com\/blog\/#\/schema\/person\/51458d9dd86dbbdd19f5add451d44efa"},"headline":"ORA-12269: client uses weak encryption\/crypto-checksumming version when creating CDB catalog","datePublished":"2022-01-12T17:09:18+00:00","dateModified":"2022-01-27T14:06:09+00:00","mainEntityOfPage":{"@id":"https:\/\/nenadnoveljic.com\/blog\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\/"},"wordCount":1388,"commentCount":3,"articleSection":["encryption","Oracle"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/nenadnoveljic.com\/blog\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/nenadnoveljic.com\/blog\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\/","url":"https:\/\/nenadnoveljic.com\/blog\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\/","name":"ORA-12269: client uses weak encryption\/crypto-checksumming version when creating CDB catalog - All-round Database Topics","isPartOf":{"@id":"https:\/\/nenadnoveljic.com\/blog\/#website"},"datePublished":"2022-01-12T17:09:18+00:00","dateModified":"2022-01-27T14:06:09+00:00","author":{"@id":"https:\/\/nenadnoveljic.com\/blog\/#\/schema\/person\/51458d9dd86dbbdd19f5add451d44efa"},"description":"Oracle internals analysis with pintools; workaround provided","breadcrumb":{"@id":"https:\/\/nenadnoveljic.com\/blog\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nenadnoveljic.com\/blog\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/nenadnoveljic.com\/blog\/ora-12269-client-uses-weak-encryption-crypto-checksumming-version-when-creating-cdb-catalog\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/nenadnoveljic.com\/blog\/"},{"@type":"ListItem","position":2,"name":"ORA-12269: client uses weak encryption\/crypto-checksumming version when creating CDB catalog"}]},{"@type":"WebSite","@id":"https:\/\/nenadnoveljic.com\/blog\/#website","url":"https:\/\/nenadnoveljic.com\/blog\/","name":"All-round Database Topics","description":"Nenad Noveljic","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/nenadnoveljic.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/nenadnoveljic.com\/blog\/#\/schema\/person\/51458d9dd86dbbdd19f5add451d44efa","name":"Nenad Noveljic","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g","caption":"Nenad Noveljic"},"sameAs":["nenad-noveljic-9b746a6","https:\/\/x.com\/NenadNoveljic"],"url":"https:\/\/nenadnoveljic.com\/blog\/author\/nenad\/"}]}},"_links":{"self":[{"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/posts\/4068","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/comments?post=4068"}],"version-history":[{"count":1,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/posts\/4068\/revisions"}],"predecessor-version":[{"id":4105,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/posts\/4068\/revisions\/4105"}],"wp:attachment":[{"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/media?parent=4068"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/categories?post=4068"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/tags?post=4068"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}